Rebate Record is calculated by the Rebate logic element with Calculation Context "rebateRecord". The rebate logic is executed either manually by a user (on the Rebate Record Detail screen) or by the Rebate Calculation process.
...
This calculation is mostly triggered by the Rebate Calculation process.
Rebate Record
...
Logic – Specific Actions
Large part of the calculation of the RR’s results is the same as for the Line Itemline item. Those logic elements will be shared between the Line Item line item and rebate record.
In this sections we will describe only things specific for the rebate records.
rebate Rebate record logic specifics:
code Code is in the logic elements with calculation context "RebateRecord"such code will get the Calculation Context RebateRecord.
This code gets access to additional information via:
Binding Variablesvariables:
calculationBase
- holds – Holds a filter which finds the sales transactions related to this rebate record.This filter will later be used later by the Allocation process, but can be also used by the logic which calculates results for the RR.
the The filter is of type DMDataSlice/DatamartContext.DataSlice.
the The filter is pre-populated by the system automatically when you create the RR, but you can change it.
Methods:
api.currentItem()
- returns – Returns data (as map) of the currently calculated rebate record.
Rebate Record
...
Logic Results Mapping
The results calculated by the logic in the context of RebateRecords, rebate records are stored in a field "called calculationResults
", which is a Map with key-value pairs.
For easier processing, it is handy to map some of those results to the "attribute#" fields of the RR. Usually you want to keep in the "attribute#" fields only data , you’re which you are going to export or use in the allocation process or somehow else.