define([‘N/query’]
(query){
let myQuery = query.create({
type: query.Type.TRANSACTION
});
var firstCondition = myQuery.createCondition({
fieldId: ‘recordtype’,
operator: query.Operator.ANY_OF,
values: “salesorder”,
caseSensitive: true
});
let secondCondition = myQuery.createCondition({
fieldId: ‘id’,
operator: query.Operator.EQUAL,
values: scriptContext.newRecord.id
});
myQuery.condition = myQuery.and(firstCondition,
myQuery.and(firstCondition, secondCondition)
);
myQuery.columns = [
myQuery.createColumn({ fieldId: ‘tranid’ }),
myQuery.createColumn({ fieldId: ‘id’ }),
myQuery.createColumn({ fieldId: ‘transactionlines.item’ })
];
let results = myQuery.run();
log.debug(‘Sales Order Info’, results);
}