RE: Syntax error: missing ; before statement
When I upload the following code I get the error “Syntax error: missing ; before statement”
I am trying to build a saved search to pull the carton field from the Item Fulfillment Record’s Line Item Inventory Detail. I then will be taking the list of cartons and making the unique values and putting them in a field in the Header.
Try
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
*/
define([‘N/record’, ‘N/log’, ‘N/search’], function(record, log, search) {
function beforeLoad(context) {
// Log our entities
if(context.type === context.UserEventType.VIEW){
var fulfillmentRecordID = context.newRecord.id;
log.debug(“Fulfillment Id”, fulfillmentRecordID);
var inventoryDetailSearchFilters = [
[‘pickcarton’, ‘isnotempty’, ”],
‘AND’,
[‘transaction.internalid’, ‘anyof’, ‘6327795’]
];
var inventoryDetailSearchColPickCarton = search.createColumn({ name: ‘pickcarton’ });
var inventoryDetailSearch = search.create({
type: ‘inventorydetail’,
filters: inventoryDetailSearchFilters,
columns: [
inventoryDetailSearchColPickCarton,
],
});
log.debug(“Inventory Detail Search”, inventoryDetailSearch);
}
};
return {
beforeLoad: beforeLoad
};
});