Date formats

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

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

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

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