REQUIREMENT Need to set the due date of a task record based on the current date and number of days required for the completion. The due date must not be weekend days and should consider only weekdays. SOLUTION Following is a code snippet for calculating the due date excluding the weekend days. settingDueDateValue(days) { try… Continue reading Finding due date value from current date based on the number of days
Author: Jesna John
Date value gets changed on assignment and setDate()
ISSUE: When a date is assigned to a variable (say: A) and when the value of the variable is stored in another variable (say B), any changes made to variable A will alter the value in variable B. SOLUTION: The issue is that B is being set as a pointer to what A is pointing… Continue reading Date value gets changed on assignment and setDate()
Vicarious emails permission errors
ISSUE When trying to send emails through Suitescript for a particular role, an error occurred: “Permission Violation: You need the ‘Vicarious emails’ permission to access this page. Please contact your account administrator.” SOLUTION Navigate to Setup > Users/Roles > Manage Roles Preferred Role: Click Edit Click Permissions Click Setup Permission: Select Vicarious Email Level: Select Full Click Add Click Save
SuiteScript error : “Netsuite Invalid API usage. You must use getValue to return the value set with setValue”
DESCRIPTION When a new record is created and saved, this error gets thrown. But when editing this transaction after it was created, the getText does not throw this error. SOLUTION/POSSIBLE CAUSE In dynamic mode, we can use getText() without limitation but, in standard mode, limitations exist. In standard mode, you can use this method only… Continue reading SuiteScript error : “Netsuite Invalid API usage. You must use getValue to return the value set with setValue”
Restricting change of customer in sales order based on a checkbox in customer record
Following is a code snippet to restrict the change of customer in sales order. */ function fieldChanged(scriptContext) { const scriptObj = runtime.getCurrentScript(); const { currentRecord, fieldId } = scriptContext; if (fieldId ===… Continue reading Restricting change of customer in sales order based on a checkbox in customer record
Setting email address on email widget
REQUIREMENT Develop a script to populate the email of the Contact flagged for receiving the Invoice to the Message Wideget opened while sending email from the Invoice record. SOLUTION Following userevent script can be used to populate the email address in the email widget other than the email address of the entity of the invoice.… Continue reading Setting email address on email widget
Proposal For Listing Transaction Details On Custom Page
REQUIREMENT The client would like to list the Item fulfillments that are created from the Transfer order and corresponding item line-level details from the related Transfer Orders. PROPOSED SOLUTION As the standard saved search cannot be used to display the item fulfilment details along with the corresponding transfer order item line details, a custom suitelet… Continue reading Proposal For Listing Transaction Details On Custom Page
Adding HTML table to custom record
REQUIREMENT Need to add a HTML table to display the sublist details in view mode of record. SOLUTION Following is the code snippet to add the HTML table in the custom record under a custom tab. This is to be added in beforeload of user event script.
Adjusting the Tax Amount on the Invoice Item line
REQUIREMENT Client would like to develop a script that should adjust the Tax Amount on the Invoice Item line if the Gross amount is within 0.01 of a whole integer. So, this adjustment will round the Gross Amount to the nearest whole integer such that 19.99 ≈> 20 <≈ 20.01 Need to implement a script on the save… Continue reading Adjusting the Tax Amount on the Invoice Item line