Reference Product List Patch for SCA Aconcagua
To implement this patch, create a custom module to override the following JavaScript files, which are part of the ProductList module:
-
ProductList.Item.Model.js
-
ProductList.Item.Search.js
-
ProductList.Model.js
-
ProductList.ServiceController.js
If you are unfamiliar with implementing patches for SuiteCommerce Advanced (SCA), refer to:
Step 1: Set Permissions for ProductList Files
To implement this patch, set the permissions for the ProductList files.
To set permissions for ProductList.Service.ss:
-
In NetSuite, go to Documents > Files > File Cabinet.
-
In the File Cabinet, go to Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. -X.Y.Z > Development > services.
Important:Replace the string, X.Y.Z, with the version of SCA you are using.
-
Next to ProductList.Service.ss, click Edit.
-
Go to the Permission tab and check the Enabled box.
-
From the Execute as Role list, select SC Product List.
-
Check the Run Script Without Login box.
-
Click Save.
To set permissions for ProductList.Item.Service.ss:
-
In NetSuite, go to Documents > Files > File Cabinet.
-
In the File Cabinet, go to Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. -X.Y.Z > Development > services.
Important:Replace the string, X.Y.Z, with the version of SCA you are using.
-
Next to ProductList.Item.Service.ss, click Edit.
-
Go to the Permission tab and check the Enabled box.
-
From the Execute as Role list, select SC Product List.
-
Check the Run Script Without Login box.
-
Click Save.
Step 2: Create the Override Files
Create the Override File for ProductList.Item.Model.js
-
Following the instructions in the Patch Using Override Mode procedure, create a new directory and file:
/Modules/extensions/ProductListExtension@1.0.0/SuiteScript/ProductList.Item.Model.js
-
In the new
ProductList.Item.Model.js
file, find and replace the following line of code with the provided code samples.Find the following code:
if (this.configuration.loginRequired && !ModelsInit.session.isLoggedIn2()) { throw unauthorizedError; }
Replace it with the following code:
if (this.configuration.loginRequired && !ModelsInit.session.isLoggedIn3()) { throw unauthorizedError; }
Create the Override File for ProductList.Item.Search.js
-
Following the instructions in the Patch Using Override Mode procedure, create a new directory and file:
/Modules/extensions/ProductListExtension@1.0.0/SuiteScript/ProductList.Item.Search.js
-
In the new
ProductList.Item.Search.js
file, find and replace the following line of code with the provided code samples.Find the following code:
if (this.configuration.loginRequired && !ModelsInit.session.isLoggedIn2()) { throw unauthorizedError; }
Replace it with the following code:
if (this.configuration.loginRequired && !ModelsInit.session.isLoggedIn3()) { throw unauthorizedError; }
Create the Override File for ProductList.Model.js
-
Following the instructions in the Patch Using Override Mode procedure, create a new directory and file:
/Modules/extensions/ProductListExtension@1.0.0/SuiteScript/ProductList.Model.js
-
In the new
ProductList.Model.js
file, find and replace the following line of code with the provided code samples.Find the following code:
if (!!_.result(this.configuration, 'loginRequired') && !ModelsInit.session.isLoggedIn2()) { throw unauthorizedError; }
Replace it with the following code:
if (!!_.result(this.configuration, 'loginRequired') && !ModelsInit.session.isLoggedIn3()) { throw unauthorizedError; }
Create the Override File for ProductList.ServiceController.js
-
Following the instructions in the Patch Using Override Mode procedure, create a new directory and file:
/Modules/extensions/ProductListExtension@1.0.0/SuiteScript/ProductList.ServiceController.jss
-
In the new
ProductList.ServiceController.js
file, find and replace the following line of code with the provided code samples.Find the following code:
var user = ModelsInit.session.isLoggedIn2() ? nlapiGetUser() : 0 , role = ModelsInit.context.getRoleId();
Replace it with the following code:
var user = ModelsInit.session.isLoggedIn3() ? nlapiGetUser() : 0 , role = ModelsInit.context.getRoleId();
Step 3: Prepare the Developer Tools for Your Patch
When preparing the Developer Tools for your patch as described in the Patch Using Override Mode procedure, perform the following actions:
-
Paste the following sample code into the new
ns.package.json
file that you created in the directory:/Modules/extensions/ProductListExtension@1.0.0/ns.package.json
{ "gulp": { "ssp-libraries": [ "SuiteScript/*.js" ] }, "overrides": { "suitecommerce/ProductList@X.Y.Z/SuiteScript/ProductList.Item.Model.js" : "SuiteScript/ProductList.Item.Model.js", "suitecommerce/ProductList@X.Y.Z/SuiteScript/ProductList.Item.Search.js" : "SuiteScript/ProductList.Item.Search.js", "suitecommerce/ProductList@X.Y.Z/SuiteScript/ProductList.Model.js" : "SuiteScript/ProductList.Model.js", "suitecommerce/ProductList@X.Y.Z/SuiteScript/ProductList.ServiceController.js" : "SuiteScript/ProductList.ServiceController.js" } }
Important:Replace the string, X.Y.Z, with the version of the module in your implementation of SCA.
-
Open the
distro.json
file in the root SCA development directory and then add your custom module to themodules
object as described in the Patch Using Override Mode procedure. The following sample shows the value to add to the list of existing values that follow the “modules
” key."modules": { "extensions/ProductListExtension": "1.0.0", ...}
Step 4: Test and Deploy Your Patch
Follow the instructions provided in the Patch Using Override Mode procedure to test and deploy your patch.
Step 5: Confirm Custom Record ID and Access Type
-
In NetSuite, go to Customization > List, Records & Fields > Record Types.
-
Click the link for the custom record type, Product Lists.
-
On the Custom Record Type page for Product Lists, confirm that ID has the value,
customrecord_ns_pl_productlist
. -
Confirm that Access Type has Use Permission List selected.
If the access type is not correct, select Use Permission List from Access Type.
-
Click Save to save any changes you made.
-
Repeat steps 1 to 5 for the following custom record type:
Product Lists Items – the ID should be
customrecord_ns_pl_productlistitem
and the access type should be Use Permission List.
Step 6: Add Item List Permission to View
-
In NetSuite, go to Setup > Users/Roles > Manage Roles.
-
Next to the SC Product Lists role with the ID,
customrole_sc_product_lists
, click Edit. -
Go to the Permissions tab and the Lists subtab.
-
For the permission, Items, confirm the level is set to View.
If the Items permission level is not View, update the level to View, then click Save.
Related Topics
- Changes in Product Reviews and Product List Permissions Levels
- Reference Product List Patch for SuiteCommerce, SCA 2024.2.10, and Later
- Reference Product List Patch for SCA 2024.2
- Reference Product List Patch for SCA 2019.2 to 2024.1
- Reference Product List Patch for SCA 2018.2 to 2019.1
- Reference Product List Patch for SCA Kilimanjaro
- Reference Product List Patch for SCA Elbrus
- Reference Product List Patch for SCA Vinson
- Reference Product List Patch for SCA Mont Blanc
- Reference Product List Patch for SCA Denali
- Reference Product List Patch for Reference ShopFlow
- Reference Product List Patch for Reference My Account