web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Data entity update error in initializeEntityDataSource() for multiple company

(0) ShareShare
ReportReport
Posted on by 625

I have a new data entity which main table has SaveDataPerCompany = No, and it has joined data source to inventDim which is company specific. 

During update, in the initializeEntityDataSource() method, during the super call, it is calling those initialize data source for each one added in the data entity. So for inventDim, i got the following error when the record is not in my current company: 
Cannot locate data source record of type InventDim with RecId 5637177617. Entity name: xxx, RecId: 5637197827, Database operation: Update.

inventDim data will not be updated for my business scenario, if i remove the super call, the whole entity record is not updated which is not the case i want.   

Is there a way that i can skip the initialize data source for inventDim ?

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi SLC,

    i have a couple of questions here -

    1. If the main table has "SaveDataPerCompany = No", how is it linked to InventDim. It can't be based on the InventDimId only as InventDim is company Specific.

    2. In case InventDim does not need to be updated, have you tried setting "IsReadOnly" property to "True" for InventDim data source?

  • tyhj Profile Picture
    625 on at

    Hi Gunjan,

    1. Main table has a legalEntity field, inventDim datasource is linked by the inventDimId, and InventDimId.DataAreaId with the main table legalEntity field. But in the data entity I'm using an unmapped field string for the field because during insert I need to import data other than the current legal entity.

    I have checked this post - docs.microsoft.com/.../cross-company-behavior

    but not applicable to me as I do not have the "dataAreaId" field.

    2. I've just try to change the property but seem like no difference.

  • Suggested answer
    tyhj Profile Picture
    625 on at

    Just an update to this question, I have changed my data entity to remove the InventDim data source, then add the invent fields as unmapped string field and handle the data mapping through code, its working fine.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans