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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Cannot locate datasource record of type logisitcsPostalAddress with RecId xx. EntityName: logisticsPostalAddressBaseEntity, RecId xx, Database operation: Update

(0) ShareShare
ReportReport
Posted on by 446

Hi,

If i try to update a deactivated address by code using logisticsPostalAddressHistoricalCDSV2Entity.Update()

I get this error:

Cannot locate datasource record of type logisitcsPostalAddress with RecId xx. EntityName: logisticsPostalAddressBaseEntity, RecId xx, Database operation: Update

Is it because it is old?

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,217 Super User 2025 Season 2 on at
    RE: Can we update history addresses?

    Hi Deldyn,

    What is the business requirement to update historical addresses? Anyway, the table has Valid time state enabled.

    have you provided the valid from and to date/time values and does the entity has the ValidTimeStateUpdateMode property set to Correction when updating the record(s)?

  • DELDYN Profile Picture
    446 on at
    RE: Can we update history addresses?

    Hi Andre,

    I have a custom service that inserts new postal addresses or if the record already exists it calls the update method.

    I use logisticsPostalAddressHistorecalCDSV2Entity and I don't specify validTimeStateUpdateMode

    Which means by default, the value is CreateNewTimePeriod

    The service is working fine, but there is one time where i got this error and after investigating I noticed that the address passed to the service is old(it seems the other system didn't delete the address while FO deleted/removed it and it's in the history). So my question is, did this error appear because it's an old address?

    If yes, do i need to handle it in a specific way like correction?

  • André Arnaud de Calavon Profile Picture
    300,217 Super User 2025 Season 2 on at
    RE: Cannot locate datasource record of type logisitcsPostalAddress with RecId xx. EntityName: logisticsPostalAddressBaseEntity, RecId xx, Database operation: Update

    Hi Deldyn,

    When there is a change in the address, usually a new record will be created with a new timestamp (insert). I would suggest follow the same approach and send only an address once the address really got changed in your application.

  • DELDYN Profile Picture
    446 on at
    RE: Cannot locate datasource record of type logisitcsPostalAddress with RecId xx. EntityName: logisticsPostalAddressBaseEntity, RecId xx, Database operation: Update

    Hi Andre,

    As i said the address got deleted from FO. But remained in the other system. So when the system edited it and called FO service i got this error.

    My question was, did i get this error because it's an old address??

    I think the business will ask me to reactivate it in this case..but i want to understand why i got the error in the first place

  • André Arnaud de Calavon Profile Picture
    300,217 Super User 2025 Season 2 on at
    RE: Cannot locate datasource record of type logisitcsPostalAddress with RecId xx. EntityName: logisticsPostalAddressBaseEntity, RecId xx, Database operation: Update

    Hi Deldyn,

    When you "delete" and address from F&O, the record will not be deleted, but the valid to field will be filled. When this address was removed from F&O and you try to update your other system accordingly, you can't use a delete trigger as F&O updates the existing record. That would probably the reason why the other system still has the address.

    As mentioned, don't try to update F&O addresses from external applications as the date effectiveness on F&O tables is really cumbersome for data entities.

  • DELDYN Profile Picture
    446 on at
    RE: Cannot locate datasource record of type logisitcsPostalAddress with RecId xx. EntityName: logisticsPostalAddressBaseEntity, RecId xx, Database operation: Update

    Hi Andre,

    I know that when the address in FO got removed (ValidTo value changed) -- the other system wasn't notified.

    Now when the other system tries to update the address that got removed from FO..it calls the custom service and tries to update the address. My question is why this error appeared, why the entity doesn't allow updating an old address? Because of what? Is there a technical explanation for this error to appear, is it because this entity for example doesn't look at old addresses that's why it says recId doesn't exist even though it exists? Or what happened exactly?

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 582 Most Valuable Professional

#3
CU05031448-0 Profile Picture

CU05031448-0 526

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans