AfterDetailMap Event
This Event will fire for a record after any child datasets have been processed, and is not available at field-level.
If the parent dataset has multiple records, then it will fire once after each record's child datasets are processed.
Using this Event gives one last go at writing to the destination current parent record before moving on to the next source dataset parent record.
In other words, it provides the opportunity to record data that has been amassed or calculated during the processing of the child records - such as the total number of items in the order being processed, or the total value of all the lines that make up that particular current order.
In the following example, AfterDetailMap allows the engine to write values to the destination dataset from the variables OrdTotalExcl and OrdTotalIncl - these variables had been calculated and maintained during processing.
procedure
AfterDetailMapEvent(
var
Value:Variant);
//ORDER_HEADER
begin
D_ORDER_HEADER[
'OrdTotalExcl'
].Value := LOCALS[
'OrdTotalExcl'
].Value;
D_ORDER_HEADER[
'OrdTotalIncl'
].Value := LOCALS[
'OrdTotalIncl'
].Value;
end
;