Hello,
I am using the following code to display a message if a certain item is added to a line on a sales order. The message will only display if the item is entered on the first line and will not work if added as a later line? Do you know what I’m doing wrong?
function postSourcing(context) {
var currentRecord = context.currentRecord;
var sublistName = context.sublistId;
var sublistFieldName = context.fieldId;
if (sublistName === 'item' && sublistFieldName === 'item')
if (currentRecord.getCurrentSublistValue({
sublistId: sublistName,
fieldId: sublistFieldName
}) === '392')
message.create({
title: 'Title’,
message: 'Message',
type: message.Type.ERROR,
duration: 10000
}).show();
}