Function to get the promotion id from the line level

The function to know if the current line is a free gift or the line is the part of promotion:

Method 1:

let isCurrentItemFreeGift = currentRec.getCurrentSublistValue({

                            sublistId: ‘item’,

                            fieldId: ‘freegiftpromotion’

                            });

Method 2:

let checkCurrentDiscountItemIsForPromotion = currentRec.getSublistValue({

                                                                                    sublistId: ‘item’,

                                                                                    fieldId: ‘custreferralcode’,

                                                                                    line: currentLines

                                                                                     });

‘checkCurrentDiscountItemIsForPromotion’ will provide the internal id of the promotion record.

Leave a comment

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