Hello,
We have sales orders coming in via EDI, SOAP services. We have a User Event script to update some custom fields on the sales orders based on certain customer related data. The script works fine on orders manually entered, but is not working for EDI orders.
Below is a snippet of code. In debugging messages, the script is showing that objOrder.getValue('subtotal') = 10. But the Subtotal of the order is actually $1255.50.
I have no idea where 10 is coming from but my question is about timing. Should the afterSubmit function have the correct subtotal for an order created through SOAP Services?
I'll also just mention that I know other data on the order is available because it's being used to look up another custom record based on customer/entity. Script version 2.0.
function afterSubmit(context) {
try {
var objOrder = context.newRecord;
var transactionId = context.newRecord.id;
stLogTitle = stLogTitle + ' Record Id : ' + transactionId
var transactionType = context.newRecord.type;
var customer = objOrder.getValue('entity');
var billToSelectId = objOrder.getValue('billaddresslist');
var objFilter = {}
objFilter.entity = objOrder.getValue('entity');
objFilter.total = objOrder.getValue('subtotal')
objFilter.partner = objOrder.getValue('partner');
objFilter.trandate = objOrder.getValue('trandate');
Any ideas why the subtotal might not be available?
Also, does anyone have suggestions on best way to learn advanced scripting?
Thanks,
Judy