Adjustment Line Item Callback Class
Adjustment Line Item Callback allows you to write custom logic to auto-create or auto-delete adjustments for the line items. For example, once a product is added to cart, some adjustments need to be auto-included based on the account contract or other terms. In such a case, you can use Adjustment Line Item callback to automate this process. When you apply an adjustment on a proposal, the callback will overwrite manual adjustments.
Agents can change the discounts anytime and that will not reflect on the cart. Agents cannot do this manually per line item, so we have given the custom page for them to manage the discounts.
To use the Adjustment Line Item Callback you must create a custom Apex class that implements the Apttus_Config2.CustomClass.IAdjustmentLineItemCallback2 interface and register the custom apex class with Adjustment Line Item Callback Class. You must write your custom logic in the custom apex class.
The following methods are available in the Apttus_Config2.CustomClass.IAdjustmentLineItemCallback2 interface:
Method | Signature | Description |
---|---|---|
createAdjustmentLineItems() | List createAdjustmentLineItems(Apttus_Config2.LineItem) | You can use this method to create adjustments for the given parent line item |
finish() | void finish() | This the last method that is executed after the callback is invoked. |
start() | void start(Apttus_Config2.ProductConfiguration) | This is the first method that is executed when the callback is invoked. |
beforeSaveAdjustmentLineItems() | Boolean beforeSaveAdjustmentLineItems(Apttus_Config2.LineItem, List) | You can use this method to apply custom logic after the user adjustments are finished and before the changes are saved. |
Example