Skip to main content

Notifications

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 308

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?

  • DELDYN Profile Picture
    DELDYN 308 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?

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,996 Super User 2025 Season 1 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
    DELDYN 308 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
    André Arnaud de Cal... 291,996 Super User 2025 Season 1 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
    DELDYN 308 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
    André Arnaud de Cal... 291,996 Super User 2025 Season 1 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)?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,996 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,853 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans