John-Paul Jorissen
04/01/2019, 5:56 PMfunction modifiedDateSearch(){
const results = []
var mySearch = search.create({
"type": "vendor",
"filters": [
['lastmodifieddate', search.Operator.WITHIN, '20DaysAgo']
],
"columns": entityColumns,
})
mySearch.run()
.getRange({
start: 0,
end: 1000
})
.forEach(function(result)
{
results.push(JSON.stringify(result));
}
)
return results
}
where entityColumns
is an array containing each of the Internal IDs listed in the “Search Columns” table of this document” http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2018_1/script/record/vendor.html .John-Paul Jorissen
04/01/2019, 5:57 PM{"type":"error.SuiteScriptError","name":"SSS_INVALID_SRCH_COL","message":"An nlobjSearchColumn contains an invalid column, or is not in proper syntax: language."}
for several columns. Why can I not include these columns, and is there a way for me to get them if I need them?John-Paul Jorissen
04/01/2019, 6:07 PMconst entityColumns = [
'accountnumber',
'address',
'addressee',
'addressinternalid',
'addresslabel',
'addressphone',
'altcontact',
'altemail',
'altname',
'altphone',
'attention',
'balance',
'billcountrycode',
'billzipcode',
'category',
'city',
'comments',
'companyname',
'contact',
'country',
'countrycode',
'creditlimit',
'currency',
'currentexchangerate',
'datecreated',
'eligibleforcommission',
'email',
'emailpreference',
'emailtransactions',
'entityid',
'entitynumber',
'expenseaccount',
'externalid',
'fax',
'faxtransactions',
'firstname',
'formulacurrency',
'formuladate',
'formuladatetime',
'formulanumeric',
'formulapercent',
'formulatext',
'fxbalance',
'fxunbilledorders',
'giveaccess',
'globalsubscriptionstatus',
'hasduplicates',
'homephone',
'image',
'incoterm',
'internalid',
'is1099eligible',
'isdefaultbilling',
'isdefaultshipping',
'isinactive',
'isjobresourcevend',
'isperson',
'laborcost',
'language',
'lastmodifieddate',
'lastname',
'lastviewed',
'level',
'middlename',
'mobilephone',
'payablesaccount',
'pec',
'permission',
'phone',
'phoneticname',
'printoncheckas',
'printtransactions',
'purchaseorderamount',
'purchaseorderquantity',
'purchaseorderquantitydiff',
'receiptamount',
'receiptquantity',
'receiptquantitydiff',
'representingsubsidiary',
'salutation',
'shipcountrycode',
'state',
'statedisplayname',
'subscription',
'subscriptiondate',
'subscriptionstatus',
'subsidiary',
'subsidiarynohierarchy',
'taxidnum',
'terms',
'title',
'type',
'unbilledorders',
'url',
'vatregnumber',
'workcalendar',
'zipcode',
]
rustyshackles
04/01/2019, 6:20 PMJohn-Paul Jorissen
04/01/2019, 6:21 PMJohn-Paul Jorissen
04/01/2019, 6:23 PMcolumns
parameter should correspond to a field on each of the objects in the result set, right?stalbert
04/01/2019, 6:28 PMgetValue
on each result fieldJohn-Paul Jorissen
04/01/2019, 6:28 PMstalbert
04/01/2019, 6:29 PMJohn-Paul Jorissen
04/01/2019, 6:29 PMstalbert
04/01/2019, 6:29 PMJohn-Paul Jorissen
04/01/2019, 6:30 PMstalbert
04/01/2019, 6:32 PMJohn-Paul Jorissen
04/01/2019, 6:32 PMstalbert
04/01/2019, 6:32 PMJohn-Paul Jorissen
04/01/2019, 6:32 PMJohn-Paul Jorissen
04/01/2019, 6:33 PMmySearch.run()
.getRange({
start: 0,
end: 1000
})
.forEach(function(result)
{
results.push(JSON.stringify(result));
}
)
return results
John-Paul Jorissen
04/01/2019, 6:33 PMstalbert
04/01/2019, 6:49 PMJSON.stringify()
and using the output is asking for trouble, as there is no documented structure for the output of that call, and hence NS can change it at any time.stalbert
04/01/2019, 6:50 PMstalbert
04/01/2019, 6:51 PMresult
is your only reliable (documented) object to use above, not the string output of JSON.stringify()
)John-Paul Jorissen
04/01/2019, 6:56 PM