Monday, November 26, 2018

Retrieving the Transaction type of Created From field for Item Receipt and Fulfillment via Script

On the Created From field, we can only get the internal id of the transaction and it is often asked how to find out the type of transaction it is.

This can be retrieved using the field 'ordertype'. This field may not be seen as exposed on the Suitescript Browser, but this field can be used on the script.

Currently this can be retrieved by using the following APIs:


 var rec = nlapiLoadRecord('itemreceipt',210);
 var tranType = rec.getFieldValue('ordertype');

This is not available yet using search APIs such as nlapiSearchRecord or nlapiLookupField and will only return that this is an invalid column.

These are the values returned by the field:

For Item Receipt:
'RtnAuth' - Return Authorization
'PurchOrd' - Purchase Order
'TrnfrOrd' - Transfer Order

For Item Fulfillment:
'VendAuth' - Vendor Return
'TrnfrOrd' - Transfer Order
'SalesOrd' - Sales Order


No comments:

Post a Comment