Generate Internal and External URLs for Suitelets in SuiteScipt 1.0

In NetSuite, you can use the standard function nlapiResolveURL() to create URLs for Suitelets and other script-based pages. The function signature is as follows:

nlapiResolveURL(type, identifier, id, displayMode);

Parameters:

  1. type: The type of script you are generating the URL for (e.g., 'SUITELET').
  2. identifier: The internal ID of the script (e.g., 'customscript_testscript').
  3. id: The deployment ID of the script (e.g., 'customdeploy_testscript').
  4. displayMode: Optional parameter that defines how the URL will be accessed:
  • Use 'external' to generate an external URL that can be accessed without logging into NetSuite (if permissions allow).
  • Use null (or omit this parameter) to generate an internal URL that requires users to be logged into NetSuite.

External URL:

var externalUrl = nlapiResolveURL('SUITELET', 'customscript_jj_sl_estiamte_approve_or_c', 'customdeploy_jj_sl_estimate_approve_chan', 'external');

Internal URL:

var internalUrl = nlapiResolveURL('SUITELET', 'customscript_jj_sl_estiamte_approve_or_c', 'customdeploy_jj_sl_estimate_approve_chan', null);

Leave a comment

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