Источник:
https://erconsult.eu/blog/cross-comp...n-in-dynamics/
==============
Cross-company data sharing vs. Duplication in Dynamics
Cross-company data sharing
Cross-company data sharing in Dynamics 365 for Finance and SCM (see
System administration > Setup > Configure cross-company data sharing) supposed to be a valid replacement of the virtual companies in Dynamics AX2012 and earlier. I don’t know how about you, but I get the error “
Table … is a Main table as specified by the table group and may not be shared unless its Data Sharing Type is Duplicate” every time I wish to share something useful.
It looks for the
TableGroup property in the D365 table metadata and practically rejects any table which is not a
Group or does not have a simple primary key. What is left for sharing? Some little configuration tables such as the Delivery terms (INCOTERMS), Payment terms ans so on: only these have the
TableGroup =
Group. This rules out the most interesting tables in Dynamics such as the
InventTable (Product list),
CustTable (Customers) or
VendTable (Suppliers) (well, this is not entirely true: for the latter there is a dedicated Feature
Customer and Vendor master data sharing available for activation). Namely, these have
TableGroup =
Main.
The TableGroup property of the standard tables is not extendable. The developers left a backdoor: a
Main table with the property
DataSharingType explicitly set to
Single or
Duplicate may be eligible too.
CustTable is an example. Needless to say, the DataSharingType is not extendable either. There seems to be a yet another backdoor in the form of the
SysDataSharingTypeTableConfiguration table where this
DataSharingType is supposed to be
configured. However, this feature is protected by the flight
EnableSysDataSharingTypeTableConfiguration. As with every
flight it is very promising and tempting but it remains hard-locked in any production environment.
Dead end? Not quite.
Recurring ‘Copy into legal entity’ data project
In
Data management, create a new data project of the
Copy into legal entity kind, select the destination company(ies) and the appropriate entity or entities:

It should not grab unfinished work, though. In this example it is obvious to only consider an
approved bill of materials. The BOM
lines do not have an
approved flag, but if there is no BOMId, no line can be copied either, i.e. it is sufficient to only filter the BOM
headers. In general, you should take care of the data consistency. In the particular case of the bills of materials, they should not contain any unknown items or refer to any local inventory dimension such as the site, warehouse or the warehouse location: ensure the default sites in all companies in question have the same code “STD” or “DEF”, and set the
Resource consumption checkbox in all lines to make them warehouse-agnostic. The Approver is not a problem, since the employee list is technically shared across all legal entities.
Click
Copy into legal entity in batch and set a
Recurrence e.g. every weekday. The data project may be run over and over again in a cycle copying the same data, but it is not a problem as it works in the UPSERT mode in Dynamics. However, as the data grows the data project runs slower. We should restrict the set and take only the changes of the day, for example. If you are lucky, there will be a
ModifiedDateTime column you can use in the
Filter:
(here with a Join and an
advanced moving date query).
The post
Cross-company data sharing vs. Duplication in Dynamics appeared first on
ER-Consult.
Источник:
https://erconsult.eu/blog/cross-comp...n-in-dynamics/