When you create/change/delete a data record, the MDM checks whether a relation exists for the corresponding table. If this is the case, the global database trigger events are executed and an attempt is made to distribute the changed data record to the target companies.
Since it is not known when the events are executed which field of a data record has changed, all relation rows must be processed. Unfortunately, checking for individual changed field contents is not possible with the currently available standard parameters.
This means that when a data record is changed from a table for which a relation has been set up, all the fields set up between the source and target companies are always compared to see whether there was a change or not. It doesn't matter whether the changed field is actually included in the relation or not.
Example: Distribution of table 27 Item after modifying field 22 "Unit Cost"
A relation has been set up and released for table 27 Item, but field 22 "Unit Cost" is not distributed. When posting the item, field 22 "Unit Cost" (according to the current BC23.0 standard) is always set and the data record is modified. So if the field has now been changed, which was not set up in the relation, but for whose table a released relation exists, the entire data record is still checked for changes field by field. In this case, this obviously costs unnecessary resources.
In MDM it is possible to disable the distribution of data records when posting. To do this, in the codeunit 5581419 "BET MDM Disable Distrn TempMgt" in the procedure SetRecordForDisabledTables the session unique id and the table id, which should not be distributed during posting must be added to the table 5581420 "BET MDM Disable Distrn Temp". When modifying the table during posting, before executing the MDM's distribution procedures, it is checked whether a record with the table id and the session unique id exists in the table 5581420 "BET MDM Disable Distrn Temp" and the distribution procedure will exit.
It is then urgently necessary to clear the record from table 5581420 "BET MDM Disable Distrn Temp" so that distribution continues to take place outside of the posting process!
The steps for avoiding the distribution of a table during posting are:
Create a new record in table 5581420 "BET MDM Disable Distrn Temp" withe the table id of the disabled table before the modify of a record by calling procedure SetRecordForDisabledTables in codeunit 5581419 "BET MDM Disable Distrn TempMgt"
Run the posting
Clear the record of the disabled table after the modify of a record by calling procedure ClearRecordForDisabledTables in codeunit 5581419 "BET MDM Disable Distrn TempMgt"
Example: Avoid distribution of table 27 Item after modifying field 22 "Unit Cost"
Subscribe to an event that is called before the modification of a table. For this example we can use the event OnUpdateUnitCostOnAfterCalcRunOnModifyTrigger in procedure UpdateUnitCost of codeunit 5804 ItemCostManagement.
The procedure SetRecordForDisabledTables in codeunit 5581419 "BET MDM Disable Distrn TempMgt" must then be called in the EventSubscriber procedure. The table ID (in this example: 27) for which distribution should be deactivated during posting is passed.
When the global database trigger events are executed, the MDM then checks whether the table ID of the data record to be changed is present in the list by calling the IsTableDisabledForDistribution procedure of the codeunit 5581419 "BET MDM Disable Distrn TempMgt".
If this is the case, the data set will not be checked and distributed by the MDM, otherwise the data set will be checked and distributed by the MDM.
After modifying the data record, the record in table 5581420 "BET MDM Disable Distrn Temp" should definitely be cleared again to ensure the distribution of the data records outside of a posting. To do this, another EventSubcriber must be created, which then calls the procedure ClearRecordForDisabledTables in codeunit 5581419 "BET MDM Disable Distrn TempMgt" to delete the record.
In the example we use the event OnUpdateUnitCostOnBeforeUpdateSKU of the 5804 ItemCostManagement codeunit.
The procedure ClearRecordForDisabledTables in codeunit 5581419 "BET MDM Disable Distrn TempMgt" must then be called in the EventSubscriber procedure to clear the record.
Attention!!!
The codeunit 5581415 BET MDM Disable Distribution and all procedures within it are obsolete. These are replaced by the procedures of codeunit 5581419 BET MDM Disable Distrn TempMgt.
Obsolete | Replaced by |
---|---|
codeunit 5581415 "BET MDM Disable Distribution" | codeunit 5581419 "BET MDM Disable Distrn TempMgt" |
SetListForDisabledTables | SetRecordForDisabledTables |
IsTableDisabledForDistribution | IsTableDisabledForDistribution |
ClearListForDisabledTables | ClearRecordForDisabledTables |
In MDM it is possible to disable the distribution of data records when posting. To do this, in the SingleInstance codeunit 5581415 "BET MDM Disable Distribution" in the procedure SetListForDisabledTables, the ID of the table must be added to a list of type integer, which should not be distributed during posting. When modifying the table during posting, before executing the MDM's distribution procedures, it is checked whether the table ID of the changed data record exists in the list of blocked tables and the distribution procedure will exit.
It is then urgently necessary to clear the list so that distribution continues to take place outside of the posting process!
The steps for avoiding the distribution of a table during posting are:
Set the list of disabled tables before the modify of a record by calling procedure SetListForDisabledTables in SingleInstance codeunit 5581415 "BET MDM Disable Distribution"
Run the posting
Clear the list of disabled tables after the modify of a record by calling procedure ClearListForDisabledTables in SingleInstance codeunit 5581415 "BET MDM Disable Distribution"
Example: Avoid distribution of table 27 Item after modifying field 22 "Unit Cost"
Subscribe to an event that is called before the modification of a table. For this example we can use the event OnUpdateUnitCostOnAfterCalcRunOnModifyTrigger in procedure UpdateUnitCost of codeunit 5804 ItemCostManagement.
The procedure SetListForDisabledTables in codeunit 5581415 "BET MDM Disable Distribution" must then be called in the EventSubscriber procedure. The table ID (in this example: 27) for which distribution should be deactivated during posting is passed.
When the global database trigger events are executed, the MDM then checks whether the table ID of the data record to be changed is present in the list by calling the IsTableDisabledForDistribution procedure of the SingleInstance codeunit 5581415 "BET MDM Disable Distribution".
If this is the case, the data set will not be checked and distributed by the MDM, otherwise the data set will be checked and distributed by the MDM.
After modifying the data record, the list of the SingleInstance codeunit 5581415 "BET MDM Disable Distribution" should definitely be cleared again to ensure the distribution of the data records outside of a posting. To do this, another EventSubcriber must be created, which then calls the procedure ClearListForDisabledTables in the SingleInstance codeunit 5581415 "BET MDM Disable Distribution" to delete the list.
In the example we use the event OnUpdateUnitCostOnBeforeUpdateSKU of the 5804 ItemCostManagement codeunit.
The procedure ClearListForDisabledTables in SingleInstance codeunit 5581415 "BET MDM Disable Distribution" must then be called in the EventSubscriber procedure to clear the list.