Reference My Account Generates Error on Load

In some pre-Denali releases of SuiteCommerce Advanced , viewing the home page of My Account results in a blank page and SuiteCommerce returns the following error:

Uncaught TypeError: Cannot read property 'is_logged_in' of undefined.

This error can occur because of the number of invoices returned for My Account is too large for the browser to load. This patch limits the number of returned invoices at 1000. To implement this patch, you must update the Application.getModel function in Models.js.

To modify Models.js:

  1. If you have not done so already, copy the Models.js file from the reference folder to your custom folder in the NetSuite File Cabinet.

    Models.js is located in the File Cabinet at My Account 1.04 > Reference My Account > ssp_libraries.

  2. Update the setPaymentMethod function in the Models.js file from your custom folder:

    Locate the following lines in Models.js:

                    var invoices_info = Application.getModel('Receipts').list({
        type: 'invoice'
        ,  internalid: _.pluck(result.invoices, 'internalid')
    }); 
    
                  

    Replace these lines with the following code:

                    var invoices_id = _.pluck(result.invoices, 'internalid');
    invoices_id.sort(function(a,b){ return parseInt(b) - parseInt(a) });
      
    var invoices_info = Application.getModel('Receipts').list({
        type: 'invoice'
        ,  internalid: invoices_id.slice(0, 1000)
    }); 
    
                  
  3. Save Models.js.

  4. Configure your SSP Application to use the custom Models.js file.

    1. Open the My Account SSP application record at Setup > SuiteCommerce Advanced > SSP Applications.

    2. On the Scripts subtab, update the Libraries list to include the Models.js file from your custom folder.

      This file must maintain the correct position at the bottom of the list of library files.

    3. Click Save.

  5. Verify that the customization was successful.

    Log in to the server and go to My Account > Overview. The home page for My Account loads successfully.

Related Topics

SCA Patches

General Notices