Articles tagged #SCRIPT
Articles tagged
#SCRIPT

Source Transaction Line Fields from Line on Sales Order onto Body Fields for Linked Work Order using SuiteScript

The User would like to source values of custom Transaction Line Fields from respective lines on a Sales Order onto Body Fields for the Linked Work Order possibly created in the following manner:

Read More

Checking Script Update Details in Script File

If we want to check when, what, and who changed a specific script, we may follow the steps below:

Read More

Set the Revenue Rec Start Date and Revenue Rec End Dates via Script

This is applicable if you want toset theRevenue Start DateandRevenue End Dateof the item members based on the item group by using it on aUserEventScript.

Read More

Update Last Modified and By fields on Custom Record when a Note is Saved using a Script

On a Custom Record, when a Note is created and saved on the Notes tab, User Notes subtab, the Last Modified Date and By fields do not get updated.

Read More

Update Lines on Sales Orders using Map/Reduce Script

Mass update lines in a Sales Order which contain a particular value by usingMap/Reducescript.

Read More

Get Total Unbilled PO Amount on Vendor Record Using Client Side Script

The total unbilled amount which can be seen in theAmountfield on theVendorrecord is based on the items' total quantity multiplied by their respective amounts. Some use cases permits users to change the rate of each item on theVendor Billrecord which will sometime exceed the totalPurchase Orderamount set in thePurchase Orderrecord.

Read More

Set the Class Column on Item Sublist to Mandatory on Company Preferences via Script

User wants to set the Item Sublist columns mandatory to ensure that important information are set on the record (e.g., the Class field).

Read More

Dynamically Add Custom Button Using User Event Scripts

A user wants to dynamically add a button in a record using aUser Eventscript.

Read More

Use a Group of Approvers in a Workflow Utilizing a Workflow Action Script

User needs toincorporatea certain group ofApprovers,SupervisorsorEmployeesto aWorkflowto handle the approval process ofa record.

Read More

Call Client Scripts from Workflow

Scenario

Client script functions can be invoked by any Workflow Action scripts that support client-based triggers (e.g. Before User Edit, After Field Edit, etc.).These functions must be issued on the Custom Formula portion of the action.

Below is an example to demonstrate how this is done. This requires basic SuiteScript and Workflow knowledge.

Solution

  1. Create a JavaScript file with the following codes:
    functionsayHello(s){alert('Hello '+s);/* * return true|false line is required to allow/disallow the workflow action to execute. * Condition will treat the function returned false if this line is omitted. * Thus, Workflow Action (e.g. Set Field Value) will not execute */returntrue;}
    Note:The above function will be called by the Workflow on Step 5.4.
  2. Navigate toCustomization>Scripting>Scripts>New
    • Click on the+logo beside theScript FilePopup List
    • Select the JavaScript file on the File Popup Window and click onSave
    • UnderDeploymentstab, add the record (Applies Tocolumn) script & workflow must be applied to (For this example,Customerrecord is used and click onSave)
  3. Navigate toCustomization>Workflows>Workflow>New
  4. Basic Information:
    • Name:EnterName
      Example:Enter
      Customer Workflow
    • Record Type:SelectCustomer
    • Sub Types:SelectCustomer
    • Execute as Admin:EnterCheckmark
    • Release Status:SelectReleased
  5. Event Definition:
    • On Create:EnterCheckmark
    • On View or Update:EnterCheckmark
  6. ClickSave
  7. ClickState 1
  8. Bottom right corner:ClickNew Action
  9. ClickSet Field Value
  10. Basic Information:
    • Trigger On:SelectBefore User Edit
    • Event Types:SelectCreate
    • Context:SelectUser Interface
    • Triggering Client Fields:SelectMemo
  11. Condition:
    • SelectFormula
    • Formula:EntersayHello(nlapiGetFieldValue('companyname'))
    • Triggering Client Fields:SelectMemo
  12. Parameters:
    • Field: SelectAccount
  13. ClickSave

Read More

Add a Placeholder Text Inside the Password Field in the Login Page of Web Store

When trying to log in on a SiteBuilder Webstore, the password field can be modified to show a placeholder text.

Read More

Remove Breadcrumbs on Specific Pages in the Web Store with JavaScript

Breadcrumbs are displayed dynamically in the Web Store using a NetSuite tag. Some NetSuite users prefer to hide these on specific pages in the Web Store.

Read More

Trigger a User Event Script on a Scheduled Script

A user would like to ensure that a User Event Script is triggered when a Scheduled Script is run.

Read More

Forecasting Preferences

You can set your company forecast preferences atSetup > Sales & Marketing Automation > Sales Preferences.

Read More

Remove Item Options and Add to Cart Button Per Item Record

Currently, un-checking the "Don't Show Price" checkbox in the Web Store tab of an item record, removes the "Add to cart" button per item product page. That will also hide the price of the item. This option will not hide the item options for matrices as well as the custom ones.

Read More

SiteBuilder > WSDK > Shopping Cart > Resolve Intermittent Dropping of Items on Google Chrome

When adding unique items into the cart using External Web Sites (WSDK), the shopping cart intermittently drops the previously added items, leaving only the recent added item. Issue is caused by changes to Chrome browser, making cross-site requests have cookies with SameSite=Lax attribute by default when not specified. (additional information can be found here)

Read More

Creating Scriptable Templates

You can create scriptable templates with a text/HTML editor outside of NetSuite, or you can use the Text Editor field on the Template subtab of the template record itself. If you create a scriptable template outside of NetSuite, save it as a plain text (.txt) or an HTML (.html or .htm) file.

Read More

Viewing List of Subscription Messages Sent to a Recipient

You should avoid sending recipients multiple, repetitive subscription invitation and confirmation messages. You should verify how many of these messages were previously sent before you send another message.

Read More

Resolve Error: "You Have Entered an Invalid Field Value XX for the Following Field: custrecord_8858_process_user" upon Generating Bill Payment File with Custom Role

User with custom role is trying to generate a Bill Payment file in Electronic Payments and receives the following error. This is reproducible when the custom role does not allow access to the Employee's Subsidiary.

Read More

Associating Custom Code (Client SuiteScript) Files With Custom Forms

On the Custom Code subtab, define any existing client SuiteScript files to use with this form. When the script's executing function is called, the actions defined within the script (and any built-in NetSuite actions for that form type) are performed.

Read More
Read More Articles