Sunday, May 19, 2019

Script to Search for Sales Order with a Specific Status

Below is a script that searches for Sales Orders with Status: Pending Billing:

var filters = new Array();
filters[0] = new nlobjSearchFilter('status', null, 'is', 'SalesOrd:F');
filters[1] = new nlobjSearchFilter('mainline', null, 'is', 'T');
var columns = new Array();
columns[0] = new nlobjSearchColumn('statusref');
var results = nlapiSearchRecord('salesorder', null,filters,columns);

Notice that the criteria for the status is not indicated directly as 'Pending Billing' but 'SalesOrd:F' instead. Below is a list of valid Sales Order Status that can be used in the search filter.

Equivalent in
Search Filter   |  Sales Order Status as seen in UI

SalesOrd:A         Sales Order:Pending Approval
SalesOrd:B         Sales Order:Pending Fulfillment
SalesOrd:C         Sales Order:Cancelled
SalesOrd:D         Sales Order:Partially Fulfilled
SalesOrd:E         Sales Order:Pending Billing/Partially Fulfilled
SalesOrd:F          Sales Order:Pending BillingSales Order:Billed
SalesOrd:H         Sales Order:Closed

DISCLAIMER: The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations. NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto. NetSuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.

No comments:

Post a Comment