Use of ‘encodeURIComponent’ in script

In NetSuite, the ‘encodeURIComponent’ function is useful for encoding URL parameters to prevent errors caused by special characters. It is commonly used in SuiteScript when constructing URLs for redirects or API calls. For example: The Encoded value of the given data is given below, { relatedProjects: [ “2709” ], fields: { custrecord_project_status: 10, custrecord_project_parent_charity_status: “10”… Continue reading Use of ‘encodeURIComponent’ in script

URL Encoding with encodeURIComponent

encodeURIComponent is a JavaScript function used to encode a URI component by escaping characters that might interfere with a URL, such as spaces, &, =, and ?. This ensures data is safely included in URLs. encodeURIComponent(str); str: The string to encode. Returns a new string with special characters replaced by their encoded values. Why Use… Continue reading URL Encoding with encodeURIComponent

CSV content truncated when passing from suitelet to html page

Scenario: CSV content passing from suitelet :  var csvContent = ‘Month-Year,Program,PO #,Billing type,Employee ID,Employee Name,Designation,Available Hours,Billed Hours,Invoice Currency,Invoice Rate,Invoice Value,Acsia Rate ($),Acsia Cost ($),Acsia Direct Cost ($),Customer Rate ($),Expected Revenue ($),Calculated Cost ($),Calculated Direct Cost ($),Actual Revenue ($),Gross Margin ($),Margin ($),Margin (%),Revenue Leakage ($),Resource Utilization (%),Actual RPE/Hr ($),Expected RPE/Hr ($),Direct CPE/Hr ($),CPE/Hr ($)n’;    … Continue reading CSV content truncated when passing from suitelet to html page

URL parameters are not passed properly through resolve url

Scenario: When we try to pass the parameters through url, but unable to get values from the parameters. var reportURL = url.resolveScript({   scriptId: ‘customscript_jj_sl_cpe_dashboard’,   deploymentId: ‘customdeploy_jj_sl_cpe_dashboard’,   params: {     ‘buff_filters’: buff_filters,     ‘otherFilters’: otherFilters,     ‘bill_filters’: bill_filters   },   returnExternalUrl: true }); var buff_filters = scriptContext.request.parameters.buff_filters; is not working where buff_filters=[[“custrecord_jj_cpebuff_billtype”,”is”,”Buffer”]] Solution: The issue might be related to how… Continue reading URL parameters are not passed properly through resolve url