Apply patches for Product Review for SCA 2019.2 to 2024.1 versions

First you need to set permission level for service files.

  1. In NetSuite, go to Documents > Files > File Cabinet.
  2. In the file cabinet, go to Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. – X.Y.Z > Development > services.
  3. Next to ProductReviews.Service.ss, click Edit.
  4. Go to the Permission tab and check the Enabled box.
  5. From the Execute as Role list, select SC Product Review.
  6. Check the Run Script Without Login box.
  7. Click Save.

To apply patches, follow the steps:

  1. Create ‘Extensions’ folder in the same directory where ‘Advanced’ and ‘Common’ folders reside.
  2. Copy ‘ProductReviews.Model.js’ file from Commons/ProductReviews/SuiteScript directory and past into Extensions/ProductList/SuiteScript directory.

In the new ProductReviews.Model.js file, find and replace the following line of code with the provided code samples.

Find the following code:

if (this.loginRequired && !ModelsInit.session.isLoggedIn2()) {
    throw unauthorizedError;
}

Replace it with the following code:

if (this.loginRequired && !ModelsInit.session.isLoggedIn3()) {
    throw unauthorizedError;
}

Find the following code:

if (ModelsInit.session.isLoggedIn2()) {
    review.setFieldValue('custrecord_ns_prr_writer', nlapiGetUser() + '');
}

Replace it with the following code:

if (ModelsInit.session.isLoggedIn3()) {
    review.setFieldValue('custrecord_ns_prr_writer', nlapiGetUser() + '');
}

Paste the following sample code into the new ns.package.json file that you created in the Extensions/ProductReviews directory.

{

    “gulp”: {

        “javascript”: [

            “JavaScript/*.js”

        ],

        “ssp-libraries”: [

            “SuiteScript/*.js”

        ]

    },

    “overrides”: {

        “Commons/ProductReviews/SuiteScript/ProductReviews.Model.js”: “SuiteScript/ProductReviews.Model.js”

    }

}

In the distro.json file add the path to newly created extensions.

Leave a comment

Your email address will not be published. Required fields are marked *