Hi,
I'm doing an experiment using a User Event to try push values from a Sales Order into the parent Customer record. So far I'm getting this in the debug.
Response:
>start
>nlobjDeferredDynamicRecord
>undefined
So I haven't found reference to "nlobjDeferredDynamicRecord" anywhere, nor know why saving this is returning me an undefined value.
The script is not working at the moment. Anyone has any idea why? I'm sincerely out of clues.
/** * Update Transaction details into Customer * * Version Date Author Remarks * 1.00 16 Aug 2013 felipeE * */ /** * The recordType (internal id) corresponds to the "Applied To" record in your script deployment. * @appliedtorecord recordType * * @param {String} type Operation types: create, edit, delete, xedit, * approve, cancel, reject (SO, ER, Time Bill, PO & RMA only) * pack, ship (IF only) * dropship, specialorder, orderitems (PO only) * paybills (vendor payments) * @returns {Void} */ function wf_submit(type){ nlapiLogExecution("debug","start"); try{ var record = nlapiGetNewRecord(), customer = record.getFieldValue("entity"), date = record.getFieldValue("trandate"), brand = record.getFieldValue("department"), amount = record.getFieldValue("total"), subsidiary = record.getFieldValue("subsidiary"), x = nlapiLoadRecord("customer", customer); nlapiLogExecution("debug",x); var y = x.setFieldValue("last_sales_date", date); nlapiLogExecution("debug",y); x.setFieldValue("last_sales_brand", brand); x.setFieldValue("last_sales_amount", amount); x.setFieldValue("last_sales_subsidiary", subsidiary); nlapiSubmitRecord(x); } catch(e){ nlapiLogExecution("debug",e.name,e.message); } }