Using Pre-Vinson Services with Vinson Release or Later

Documentation article about Using Pre-Vinson Services with Vinson Release or Later

·3 min read·View Oracle Docs

Services included with SuiteCommerce Advanced (SCA) prior to the Vinson release contain all the logic necessary to function with the Vinson release and later.

The Vinson release of SCA ports existing, unmodified services of previous releases. Therefore, any unmodified services using pre-Vinson architecture will function with Vinson without requiring any changes to the code. However, if you made any customizations to pre-Vinson services, you can still use your existing customizations with the Vinson release of SCA. This requires that you edit the appropriate ns.package.json file to use the existing service (.ss file).

With the Vinson release of SCA, each module's ns.package.json file contains the autogenerated-services object. This object includes a list of .ss files to automatically generate when you deploy your site plus their associated Service Controllers. The following example shows the ns.package.json file for the Account module:

json
1{
2"gulp": {
3 "javascript": [
4 "JavaScript/*.js"
5 ]
6, "ssp-libraries": [
7 "SuiteScript/*.js"
8 ]
9, "autogenerated-services":
10 {
11 "Account.ForgotPassword.Service.ss" : "Account.ForgotPassword.ServiceController",
12 "Account.Login.Service.ss" : "Account.Login.ServiceController",
13 "Account.Register.Service.ss" : "Account.Register.ServiceController",
14 "Account.RegisterAsGuest.Service.ss" : "Account.RegisterAsGuest.ServiceController",
15 "Account.ResetPassword.Service.ss" : "Account.ResetPassword.ServiceController"
16 }
17}
18}

If you have customized any services using pre-Vinson architecture, you can add code to the services array of the appropriate ns.package.json file, forcing the SCA developer tools to use existing .ss files of the same name instead of automatically generating new ones.

To use pre-Vinson services with Vinson release or later:

  1. Open the ns.package.json file located in the module containing the service file you want to use.

  2. Add the following code to the file:

    json
    , "services": [
    "SuiteScript/*.ss"
    ]

    Note:

    If a custom service (.ss file) exists in the module that bears the same name as one listed in the autogenerated-services object, this code prevents the SCA developer tools from automatically generating that .ss file. The dev tools will display a warning, informing you that the service will not be automatically generated because of the custom service with the same name. This warning is displayed as information only and does not require any action.

  3. Save the ns.package.json file.

  4. Use the SCA developer tools to deploy your services to your site.

Related Topics

General Notices

--- Context from https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4623689789.html --- Services handle HTTP requests sent by the frontend application to access backend models, which connect to NetSuite. Different releases of SuiteCommerce Advanced (SCA) handle services with significant differences. This section explains how to create a service when implementing the Vinson release of SCA or later.

  • 2019.2 implementations and later provide two options: SuiteScript 2.0 or SuiteScript 1.0. How you go about this depends on the services you are creating. These implementations require Service Controllers.

    Note:

    The following code samples use SuiteScript 1.0 functions and objects only. These examples do not include SuiteScript 2.0 capabilities.

  • SCA implementations of Vinson through 2019.1 require only SuiteScript 1.0. These implementations require Service Controllers.

Note:

If you are using custom services that pre-date the Vinson release of SCA, you can still use them without refactoring your code. SCA offers backward compatibility with any services of implementations prior to Vinson. See Using Pre-Vinson Services with Vinson Release or Later for more information.

Much of the logic required to operate a service is contained in a centralized location within the source files provided. However, you must complete the following steps to create a custom service:

Step 1: Create a Custom [Module].ServiceController

Each service requires a unique [Module].ServiceController. You create this file, where [Module] is the module using the service. To create this custom ServiceController, complete the following tasks:

  1. Create a new [Module].ServiceController file

  2. [Define the custom [Module].ServiceC

Frequently Asked Questions (4)

Do I need to modify existing uncustomized pre-Vinson services to work in the Vinson release of SuiteCommerce Advanced?
No, unmodified services from pre-Vinson releases will function with the Vinson release without any changes to the code.
How can I ensure my customized pre-Vinson services are used in the Vinson release of SuiteCommerce Advanced?
You should add your custom .ss files to the 'services' array in the appropriate ns.package.json file within your module. This prevents automatic generation of services with the same name.
What should I do if a warning appears about custom services not being automatically generated during deployment?
The warning is for informational purposes only, indicating that services with the same name will not be automatically generated due to your custom files. No action is required if this is intentional.
Is it necessary to refactor custom services from before the Vinson release when upgrading to the Vinson release?
No, if you have custom services from before the Vinson release, they can still be used with the Vinson release without needing code refactoring, thanks to backward compatibility.
Source: Using Pre-Vinson Services with Vinson Release or Later Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in General

View all General articles →