Monday, June 17, 2019

Search Vendor Bill with Signed Echosign Agreement using SuiteScript

Below is the sample code:

var filters = new Array();
filters[0] = new nlobjSearchFilter('custrecord_echosign_status', null, 'anyof', '3');
filters[1] = new nlobjSearchFilter('custrecord_echosign_parent_type', null, 'is', 'vendorbill');
filters[2] = new nlobjSearchFilter('custrecord_echosign_date_signed', null, 'within', 'today');
var columns = new Array();
columns[0] = new nlobjSearchColumn('custrecord_echosign_parent_record');
var searchresults = nlapiSearchRecord('customrecord_echosign_agreement', null, filters, columns);

if (searchresults != null){
var iCount = searchresults.length;
           for(i = 0; i <= iCount; i++){
            var venId = searchresults[i].getValue('custrecord_echosign_parent_record');
            // In this sample, venId will return the internal Id of vendor bill          
        }
       
}

No comments:

Post a Comment