Field.getSelectOptions(options)

The Field.getSelectOptions(options) method in SuiteScript 2.0, found within the N/currentRecord module, allows you to retrieve available options for dropdown select, multi-select, or radio fields within NetSuite’s record forms. These options are returned as an array of objects, with each object containing two properties: value, representing the internal ID of the option, and text, representing the… Continue reading Field.getSelectOptions(options)

Create or Edit a Custom Contact Role

There are currently the following standard NetSuite Contact Roles available: Alternate Contact Consultant Decision Maker Primary Contact We can create a new contact role under: Setup > Sales > CRM Lists Filters > Type: Contact Role For creating a new role > click New button For modifying an existing one > click Edit next to the custom role Note: The standard NetSuite Contact Roles are not editable… Continue reading Create or Edit a Custom Contact Role

Restricting File Upload to .xlsx Format

if (fileName && fileName.toLowerCase().endsWith(‘.xlsx’)) {   // Proceed with file upload } else {   // Inform the user about the error   Response.write({ output: ‘There was an error uploading the file. Only Excel files are accepted. Please try again using an Excel file.’ });   return; }

Setting Field Value Color Based on Condition in Forms

Using Inline HTML Field Type To set the color of a field value based on a condition, you can utilize the inline HTML field type. This field type allows you to input HTML code directly into the field, giving you flexibility in customizing the appearance of the field value. Setting the Condition in Default Value… Continue reading Setting Field Value Color Based on Condition in Forms

Setting Specific Date Format in Advanced HTML PDF Template

NetSuite provides a simple method to achieve this using the record.date?string(“MM/dd/YYYY”) syntax. When working with dates in NetSuite templates, it’s essential to note that the format string is case-sensitive. Therefore, it’s crucial to capitalize the format specifiers correctly. Using this syntax, you can customize the date format to suit your requirements. For instance, if you… Continue reading Setting Specific Date Format in Advanced HTML PDF Template