Michael Pope
06/06/2025, 6:51 PMasync function(){ console.log('hi') }
in a JS file (it's not attached to a script record of any sort). Is there any way to get around this? When I try to do this, it pops up with an error saying 'Syntax error: missing ; before statement'.jen
06/06/2025, 6:56 PMMichael Pope
06/06/2025, 7:03 PMrequire(['N/record', 'N/search'], function(record, search)
{
(async function() {
var s = await search.create.promise({
type: 'transaction',
filters: [
{name: 'internalid', operator: 'anyof', values:[nlapiGetRecordId()]}
],
columns: [
{name: 'createdfrom'},
{name: 'shipdate', join: 'createdfrom'},
{name: 'item'},
{name: 'displayname', join: 'item'},
{name: 'custitem_cal_type', join: 'item'}
]
});
var p = await s.runPaged.promise({pageSize:1000})
var createdfrom = '';
var duedate = '';
var items = {};
for(page_index = 0; page_index < p.pageRanges.length; page_index++)
{
var pageRange = p.pageRanges[page_index];
var page = await p.fetch.promise(pageRange);
page.data.forEach(function(result)
{
if(createdfrom == '')
{
createdfrom = result.getText({name:'createdfrom'});
}
if(duedate == '')
{
duedate = result.getValue({name:'shipdate',join:'createdfrom'});
}
var item_id = result.getValue({name:'item'});
items[item_id] = {
classification: result.getText({name: 'custitem_cal_type', join:'item'}),
displayname: result.getValue({name: 'displayname', join:'item'})
}
})
}
console.log(items);
}).then(function(){}).catch(console.log);
})
}
Michael Pope
06/06/2025, 7:06 PMAnthony OConnor
06/06/2025, 7:11 PMMichael Pope
06/06/2025, 7:23 PMMichael Pope
06/06/2025, 7:25 PMrequire(['N/record', 'N/search'], function(record, search)
{
async function tests(){}
})
Michael Pope
06/06/2025, 7:25 PMAnthony OConnor
06/06/2025, 7:55 PMAnthony OConnor
06/06/2025, 7:57 PMAnthony OConnor
06/06/2025, 8:00 PMAnthony OConnor
06/06/2025, 8:05 PMfunction pageInit(){}
...
async function ()
...
return { pageInit };
might workAnthony OConnor
06/06/2025, 8:06 PMMichael Pope
06/06/2025, 11:13 PMMichael Pope
06/06/2025, 11:13 PMAnthony OConnor
06/07/2025, 12:00 AMMarvin
06/09/2025, 9:00 AMsuitecloud.config.js
it may be running pre-deploy linting.