The script below should be deployed as a user event script on after submit event of Sales Order record.
-Go to Customization > Scripting > Scripts > New > User Event
-Select the script and on After Submit Event, input sofield_AfterSubmit
-Under Deployments Tab, select Sales Order, Released=Yes.
-Save.
function sofield_AfterSubmit(type)
{
var order;
try
{
if ((type == 'create') || (type == 'edit'))
{
order = nlapiLoadRecord(nlapiGetRecordType(),nlapiGetRecordId());
var source = order.getFieldValue('source');
var entity = order.getFieldValue('entity');
nlapiLogExecution('DEBUG', 'after submit source: ', source);
nlapiLogExecution('DEBUG', 'after submit entity: ', entity);
}
}
catch (e )
{
if (e instanceof nlobjError )
nlapiLogExecution('ERROR', 'system error', e.getCode() + '\n' + e.getDetails() )
else
nlapiLogExecution('ERROR', 'unexpected error', e.toString() )
}
}
No comments:
Post a Comment