Articles tagged #SCRIPTING
Articles tagged
#SCRIPTING

Script To Update Multi-Select Field on Save

The article applies to a very specific scenario, but it also demonstrates how to useSuiteScriptto set values on Multi-Select Fields in NetSuite.

Read More

Retrieve Values for Multi-Select Field Being Return by nlapiLookupField

Using nlapiLoadRecord then nlobjRecord.getFieldTexts function to retrieve multi-select field selected values will return an array. However this is not the case when you try to retrieve values using nlapiLookupField as it will return String values.

Read More

Transfer Values from a Multiselect Field to Another Custom Multi Select Field via Script

To be able to transfer values from a field to another field via script.

Read More

Retrieve Values from a Multi-Select Field via Scripting

If multi-select custom field exists on a sales order, the values should be retrieved that are present on an existing record.

Read More

List of Time Zone IDs for Scripting

Developers may need to use internal IDs of the time zone depending on their business needs.

Read More

Setting Up the SFTP Connector SuiteApp

Make sure the following features are enabled in your account prior to installing the SFTP Connector SuiteApp:

Read More

SFTP Connector SuiteApp

The SFTP (Secure File Transfer Protocol) Connector SuiteApp enables you to directly transfer your payment files from NetSuite to your bank servers. You can also download files from your bank server to NetSuite. The SuiteApp establishes an SFTP connection between your NetSuite account and a remote SFTP server.

Read More

Setting up an SFTP Transfer

Follow these steps to successfully connect to your SFTP server with SuiteScript:

Read More

Supported SuiteScript File Types

SuiteScript has two types of file objects: previously existing files in the NetSuite File Cabinet, and on demand files created using SuiteScript API calls such asfile.create(options)orConnection.download(options).

Read More

SuiteScript - Troubleshoot SFTP Connections and Errors

When using the N/sftpSuiteScript 2.0Module in NetSuite, problems may be encountered during the development of Script that will use it. Therefore, is highly recommended to verify all the necessary settings and possible limitations when using this Module. Below are some considerations that need to be taken with the N/sftp Module. These are good practices which we strongly recommend to be taken when using this Module.

Read More

SuiteScript Throwing MUTUALLY_EXCLUSIVE_ARGUMENTS Error During SFTP Connection

When there is a use case to send 2 types of authentication at the same time, the below code throws error MUTUALLY_EXCLUSIVE_ARGUMENTS.

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

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
Read More Articles