Reputation: 10016
The following code creates a log entry with details: UserEventType: [object Object], Internal id: 11.
define(['N/log'], function (log)
{
function afterSubmit(context)
{
log.debug({
title: 'afterSubmit',
details: 'UserEventType: ' + context.UserEventType + ', Internal id: ' + context.newRecord.id
});
}
});
How can I get a meaningful string from context.UserEventType ?
Upvotes: 0
Views: 861
Reputation: 2069
context.UserEventType is an Object.
So, to get complete log details you can either use
log.debug({
title: 'afterSubmit',
details: 'UserEventType: ' + JSON.stringify(context.UserEventType) + ', Internal id: ' + context.newRecord.id
});
or
log.debug({
title: 'afterSubmit',
details: {
'UserEventType': context.UserEventType,
'Internal id': context.newRecord.id
}
});
Upvotes: 1