Differentiate production account and sandbox account using the host To get the host id we can use var host = url.resolveDomain({ hostType: url.HostType.APPLICATION}); It returns a domain name for a NetSuite account. options.hostType : The type of domain name you want to retrieve. Set this value using the url.HostType enum. options.accountId : The NetSuite account ID for… Continue reading Identify sandbox and production
Author: Gopika Raveendran
JSON to XML
We can use this function to convert json data to xml format function OBJtoXML(obj) { try { var xml = ”; for (var prop in obj) { xml += obj[prop] instanceof Array ? ” : “<” + prop + “>”; if (obj[prop] instanceof Array) { for (var array in obj[prop]) { xml += “<” +… Continue reading JSON to XML
MISCBINARY file format
I have already found that I can upload MISCBINARY file type to netsuite file cabinet . I get an error message when I attempt to create a file with this file type. Some of MISCBINARY files are docx , xlsx , pptx , nl ……………………….. I resolved this issue by just converting the type to ‘WORD’… Continue reading MISCBINARY file format
Get primary contact Email,Phone,Name in quote print
Create a fields for email,phone,name on quote record and hide it. Create search for Name and apply to field contact name Like this we can create search for Email and Phone number and apply to field contact email and contact phone. Then we can use these newly created field id to advanced pdf to access… Continue reading Get primary contact Email,Phone,Name in quote print
https.request() errors
SSS_INVALID_HOST_CERT : The client and server could not negotiate the desired level of security. The connection is no longer usable. You may also receive this error if the domain name in the options.url parameter is spelled incorrectly or does not use valid syntax. Verify that the domain name: Has 63 or fewer characters Contains alphanumeric characters (a-z,… Continue reading https.request() errors
Optimizing SuiteScript Performance
General Scripting Guidelines Save retrieved values on a variable and use again on succeeding calls. Execute a block of code only if it satisfies a condition. Remove redundant operations or actions and lines of code which are no longer used within the script execution. Remove duplicate logic on a script that is already performed by… Continue reading Optimizing SuiteScript Performance
Padding
An element’s padding is the space between its content and its border. The padding property is a shorthand property for:padding-toppadding-rightpadding-bottompadding-left Note: Padding creates extra space within an element, while margin creates extra space around an element. This property can have from one to four values. If the padding property has four values:padding:10px 5px 15px 20px;top padding is 10pxright padding is 5pxbottom padding is 15pxleft padding is 20px If the padding property has three values:padding:10px 5px 15px;top padding is 10pxright and left padding are 5pxbottom padding is 15px If the padding property has two values:padding:10px 5px;top and bottom padding are 10pxright and left padding are 5px If the padding property has one value:padding:10px;all four paddings are 10px
Create search inside a loop
It seems like you are using search API inside the loop and consumes a lot of governance that would affect the user interaction which is not a good practice. good practice : Create the search inside a function the search result stored to an object format and call it when required, Example : const mapItemOpt = () => { let Search = search.create({ type:, filters: … Continue reading Create search inside a loop
Governance
“Governance” is the name given to NetSuite’s system for detecting and halting long-running, runaway, or resource-intensive scripts. Each script type has governance limits that it cannot exceed, and there are four types of governance limits in place for each script type. API usage limit Instruction Count limit Timeout limit Memory usage limit Below are a… Continue reading Governance
Email Capture Plugin
Make sure you have Server SuiteScript feature enabled on your NetSuite AccountNavigate to create new Email Plug-In Script Upload or select your newly created NetSuite Email Capture script and select Email Provide detailed meta data about this email capture plugin Activate newly created Email Capture plugin and test out sending in emails to newly created… Continue reading Email Capture Plugin