Setting line level values using post sourcing

If we have to source the values to line level when an item is selected we can use the post sourcing entry point in the client script

For example,

var currentRec = scriptContext.currentRecord;
var shippingMethod = currentRec.getValue({
    fieldId: 'custbody3'
});
var sublistName = scriptContext.sublistId;
var sublistFieldName = scriptContext.fieldId;
if (sublistName === 'item' && sublistFieldName === 'item') {

    if (shippingMethod === 12 || shippingMethod === '12') {
        var price = currentRec.setCurrentSublistValue({
            sublistId: sublistName,
            fieldId: 'price',
            value: -1,
        });
}

This will set the line level price leval value as custom when we select the items in the line level.

Leave a comment

Your email address will not be published. Required fields are marked *