Saturday, May 18, 2019

Retrieve the Transaction Type via SuiteScript

Sample Use-Case: User has a Client Script deployed across multiple transaction types. There are minor changes that need to be implemented depending on the transaction type, but not enough to warrant a different script.
By adding the line below to a client script, users can determine the transaction type:

Note that the return value of "nlapiGetFieldValue('type')" will not be "Sales Order", but "salesord". These values are taken from the Transaction Type IDs table (see SuiteAnswers article 10509)

Also note that the 'type' field can be used in custom fields' formulas as {type}.

No comments:

Post a Comment