In SuiteScript, you can use the N/format module to format dates in different formats. The N/format module provides methods to format dates in various formats, including the standard formats defined by ISO 8601, as well as custom formats that you can define. Here’s an example of how you can use the N/format module to format… Continue reading Date formats
Author: Gopika Raveendran
“.replace” with XML file
Steps to create XML file using “.replace” Download the sample of the XML file you want and add it to the file cabinet This is a sample image for XML tag in the sample file 3. We can replace invoiceData here by using .replace In SuiteScript, you can use the N/file module to read and… Continue reading “.replace” with XML file
Convert your key
Windows – convert a .ppk file to a .pem file Start PuTTYgen Under Actions, choose Load, and then navigate to your .ppk file. Choose the .ppk file, and then choose Open. Clear the ‘Key passphrase’ and ‘Confirm passphrase’ fields. NOTE: The passphrase is used to encrypt the key and is an extra layer of protection. If your… Continue reading Convert your key
Identify sandbox and production
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
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