1. Use nlapiGetOldRecord and retrieve the fields values using nlobjRecord.getFieldValue
function getDeletedFields(type)
{
if (type == 'delete')
{
var fields = nlapiGetOldRecord().getAllFields();
for (var i = 0; i < fields.length; i++)
{
if(fields[i] != null || fields[i] != '')
{
nlapiLogExecution('DEBUG','nlapiGetOldRecord',fields[i] + '= ' + nlapiGetOldRecord().getFieldValue(fields[i]));
}
}
}
}
2. Use nlapiGetFieldValue().
function getDeletedFields(type)
{
var custbody16 = nlapiGetFieldValue('custbody16');
nlapiLogExecution('DEBUG','custbody16',custbody16);
}
Note:
Getting the field values of the record prior to it being changed in the database (either updated or deleted) should be the same. Users can use the instance of nlobjRecord (nlapiGetOldRecord) and retrieve the field value using getFieldValue method. Users can also use nlapiGetFieldValue() API.
No comments:
Post a Comment