Step 1: Set Permissions for ProductReviews.Service.ss File
- 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: You must replace the string, X.Y.Z, with the version of SCA you are using.
- Next to ProductReviews.Service.ss, click Edit.
- Go to the Permission tab and check the Enabled checkbox.
- From the Execute as Role list, select SC Product Review.
- Check the Run Script Without Login box.
- Click Save.
Step 2: Create the Override File for ProductReviews.Model.js
- Following the instructions and in the Patch Using Override Mode procedure, create a new directory and file:
/Modules/extensions/ProductReviews@1.0.0/SuiteScript/ProductReviews.Model.js - In the new
ProductReviews.Model.jsfile, find and replace the following line of code with the provided code samples. - Find the following code:
Copy
if (this.loginRequired && !ModelsInit.session.isLoggedIn2()) {
throw unauthorizedError;
}
- Replace it with the following code:
Copy
if (this.loginRequired && !ModelsInit.session.isLoggedIn3()) {
throw unauthorizedError;
}
- Find the following code:
Copy
if (ModelsInit.session.isLoggedIn2()) {
review.setFieldValue('custrecord_ns_prr_writer', nlapiGetUser() + '');
}
- Replace it with the following code:
Copy
if (ModelsInit.session.isLoggedIn3()) {
review.setFieldValue('custrecord_ns_prr_writer', nlapiGetUser() + '');
}
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.jsonfile that you created in the Modules directory:/Modules/extensions/ProductReviews@1.0.0/ns.package.json
Copy
{ "gulp": { "javascript": [ "JavaScript/*.js" ] }, "overrides": {
"suitecommerce/{ProductReviews@X.Y.Z/SuiteScript/Configuration.js" : "SuiteScript/ProductReviews.Model.js"
}
}
- Important: You must replace the string, X.Y.Z, with the version of the module in your implementation of SCA.
- Open the
distro.jsonfile in the root SCA development directory and then add your custom module to themodulesobject 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.
Copy
"modules": { "extensions/ProductReviews": "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.