Due to the initial sync being too slow for large volume tables, we use KingsWaySoft software to upload the data to the Dataverse database before go-live.
The data gets enriched first before upload. For a lookup field to a Virtual Entity, the guid value is constructed from a rule I found on https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/power-platform/entity-modeling: This GUID consists of the data entity ID in the first 4 bytes, and the record ID of the root data source in the entity as the last 8 bytes.
As such, my enrichment script contains statement like this to construct the guid value of the lookup field to the virtual entity:
'00010c5f-0000-0000-' + SUBSTRING(FORMAT(fnoRecord.RECID, 'X'), 8, 2) + SUBSTRING(FORMAT(fnoRecord.RECID, 'X'), 6, 2) + '-' + SUBSTRING(FORMAT(fnoRecord.RECID, 'X'), 4, 2) + SUBSTRING(FORMAT(fnoRecord.RECID, 'X'), 2, 2) + '01000000'
where in this example 00010c5f-0000-0000- is the data entity ID of the virtual table in the Dataverse environment.
The problem is that this first part, the data entity ID of the virtual entity table in Dataverse, can differ on different environments (especially when a CE solution developed on tenant A is deployed through solution import on another environment on another tenant B.
I know that data entity ID can be found by looking at the data in that virtual entity (e.g. through the make portal, going to the table and viewing the data). This is however not an optiom in my enrichment script that I want to provide to multiple environments on multiple tenants (as the script would need to be modified manually for each specific environment). I've let the Kingswaysoft extension extract the metadata (entityMetadata, fieldMetadata, lookupmetadata) in tables that I can use to join in the enrichment script but this does not contain the data entity Id that I am looking for.
Filling in the virtual entity lookup value through a plugin is also not an option for the data upload due to performance.
This rather long context for my actual question: in which (metadata) dataverse table can I find this data entity Id information for a virtual table ?
Any help is welcome.