Corey Schwoebel
08/13/2024, 1:12 PMr.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'item',
value: '37984'
});
superman1987417
08/13/2024, 1:17 PMCorey Schwoebel
08/13/2024, 1:18 PMCorey Schwoebel
08/13/2024, 1:35 PMCorey Schwoebel
08/13/2024, 1:50 PMCorey Schwoebel
08/13/2024, 2:05 PMsuperman1987417
08/13/2024, 2:18 PMCorey Schwoebel
08/13/2024, 2:20 PMClay Roper
08/13/2024, 3:13 PMsuperman1987417
08/13/2024, 3:15 PMsuperman1987417
08/13/2024, 3:15 PMCorey Schwoebel
08/13/2024, 3:15 PMCorey Schwoebel
08/13/2024, 3:16 PMsuperman1987417
08/13/2024, 3:21 PMCorey Schwoebel
08/13/2024, 3:34 PMfunction createPos(data) {
for (const invoice in data) {
log.debug({title: 'invoice data', details: data})
var r = record.create({
type: record.Type.PURCHASE_ORDER,
isDynamic: true
})
r.setValue({
fieldId: 'entity',
fieldId: 11517
})
r.setValue({
fieldId: 'duedate',
value: format.parse({value: new Date(data[invoice].dueDate), type: format.Type.DATE})
})
r.setValue({
fieldId: 'memo',
value: 'Invoice# ' + invoice
})
r.setValue({
fieldId: 'location',
value: data[invoice].location
})
r.setValue({
fieldId: 'class',
value: 8
})
r.setValue({
fieldId: 'custbody_inbound_shipping_method',
value: data[invoice].shipMethod
})
r.setValue({
fieldId: 'custbody7',
value: true
})
for (var j = 0; j < data[invoice].items.length; j++) {
r.selectNewLine({
sublistId: 'item'
})
r.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'item',
value: 9482
});
r.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'description',
value: data[invoice].items[j].description
});
r.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'quantity',
value: data[invoice].items[j].units
});
r.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'rate',
value: data[invoice].items[j].costPrice
});
r.commitLine({
sublistId: 'item'
})
}
r.save()
}
};
Corey Schwoebel
08/13/2024, 3:34 PMClay Roper
08/13/2024, 3:38 PMCorey Schwoebel
08/13/2024, 3:38 PMClay Roper
08/13/2024, 3:40 PMCorey Schwoebel
08/13/2024, 5:26 PMGMR Admin
08/13/2024, 10:21 PMGMR Admin
08/13/2024, 10:22 PMGMR Admin
08/13/2024, 10:23 PMbattk
08/14/2024, 12:04 AMbattk
08/14/2024, 12:04 AMbattk
08/14/2024, 1:32 AMCorey Schwoebel
08/14/2024, 1:33 PM