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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Cannot locate data source record of type TableB with RecId 5637146077. Entity name: XXX, RecId: 5637234576, Database operation: Update.

(0) ShareShare
ReportReport
Posted on by 102

Hi,

I have the Data entity with two datasources related.

Main entity datasource (TableA) is actually a table related to multiple tables (e.g. TableD, TableB, TableC) with refRecId and refTableId.

I created a data entity for exporting data from TableA but only records related to TableB.

The thing is that TableA is multicompany (save data per company = no) and TableB is company specific (save data per company = yes).

I want this data entity to be multicompany, so I can export and import data from one legal entity to all legal entities.

Exporting data is not a problem, it exports all records from multiple legal entities. Also, when I am importing new records, it is also ok.

But when it comes to update, I am getting error:


Cannot locate data source record of type TableB with RecId 5637146077. Entity name: XXX, RecId: 5637234576, Database operation: Update.

Any help?

I have the same question (0)
  • Suggested answer
    Ziyao Profile Picture
    Microsoft Employee on at

    Hi,

    As you mentioned Table A is actually shared data table, but Table B is company specific. When you try to update a record in Legal entity B, but currently you are in legal entity A, then system will only query this record in legal entity A for table B. Which will give you an error that record can not be found.  In such case, you need to considering "Cross Company" behavior.

    For detail information, please refer to below link:

    docs.microsoft.com/.../cross-company-behavior

  • devgirlX Profile Picture
    102 on at
    [quote user="Ziyao"]

    Hi,

    As you mentioned Table A is actually shared data table, but Table B is company specific. When you try to update a record in Legal entity B, but currently you are in legal entity A, then system will only query this record in legal entity A for table B. Which will give you an error that record can not be found.  In such case, you need to considering "Cross Company" behavior.

    For detail information, please refer to below link:

    docs.microsoft.com/.../cross-company-behavior

    [/quote]

    Hi Ziyao,

    Yes, ofcourse, I agree, I just forgot to say that I have overriden methods: mapEntityTODataSource, findEntityDataSource, updateEntityDatasource where I am using crosscompany query to find specific record and it finds it for update, but sometimes later in some data entity's methods it is searching again for that record and not using cross company ofcourse, so it overwrites my record which I found using cross company query.

    I tried this now (from the link you provided):

    pastedimage1599469270016v1.png

    But now update works and for insert I am getting the error that matching record does not exist.

  • Ziyao Profile Picture
    Microsoft Employee on at

    Could you please describe a little more about the error "matching record does not exist" for inserting?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 580

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 406 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 272 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans