Sunday, February 3, 2019

Difference Between nlapiGetCurrentLineItemValue() and nlapiGetLineItemValue()



There are two Functions for accessing Line Items in Sublists - nlapiGetCurrentLineItemValue() and nlapiGetLineItemValue().
These two Functions perform the same in most contexts except Client Scripts. In Client Scripts the retrieved Values can be different.

The nlapiGetCurrentLineItemValue() Function should be used to pull the new value that is being compared/validated/recalculated in Edit Mode. Use nlapiGetLineItemValue() to get the old/stale value.

Example:

Quantity on the SalesOrder Item "Item1" is 5.


Then in Edit Mode the Quantity of the "Item1" is changed from 5 to 7.

To get the old Value (5) use nlapiGetLineItemValue( 'item', 'quantity', 1 ).
To get the new just entered Value (7) use nlapiGetCurrentLineItemValue( 'item', 'quantity' ).

No comments:

Post a Comment