I am trying to create a D365FO data entity to add documents to the SalesAgreementHeader table. The primary datasource I am using is the DocuRefEntity with the SalesAgreementHeader as a child datasource. When working with other tables that have dataAreaIds, I would setup relations between the RefTableID, RefRecId and RefCompanyId. With this table, I only have the RefTableId and the RefRecId. The field RefCompanyId is required, but it will not allow me to have it as an exposed field (inert not allower for field DocuRefEntity.RefCompanyId).
I tried to set it in the mapEntityToDataSource and PostLoad methods, and neither of these work. How can I set the RefCompanyId for this entity?