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

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 100

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
    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
    100 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
    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

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 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans