Sunday, April 14, 2019

SuiteScript > Create a Transaction Saved with 'Applied To Transaction' Filters and Columns

The script below shows how to create a Transaction search that would join 'Applied to Transaction' fields in the filters and results of the search.

 

Here are the filters of the search:

Applied to Transaction:Type = SO
Item:Type = Inventory Item
Status = Item Fulfillment:Shipped

Here are the columns of the search:

Customer

Applied to transaction
Applied to transaction: Amount

 

var filters = new Array();

filters[0] = new nlobjSearchFilter( 'type', 'appliedtotransaction', 'is', 'SalesOrd' );

filters[1] = new nlobjSearchFilter( 'type', 'item', 'is', 'InvtPart');

filters[2] = new nlobjSearchFilter( 'status', null , 'anyof', 'ItemShip:C');

 

var columns = new Array();

columns[0] = new nlobjSearchColumn('entity');

columns[2] = new nlobjSearchColumn('appliedtotransaction');

columns[3] = new nlobjSearchColumn('amount','appliedtotransaction');

 

var searchResults = nlapiSearchRecord('transaction', null, filters, columns); 

No comments:

Post a Comment