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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Cannot edit a record in Purchase lines history (PurchLineHistory). Update on a valid time state table is not allowed without specifying a ValidTimeStateUpdateMode.

(0) ShareShare
ReportReport
Posted on by

Hi All while renaming the Batch number i got this error

Cannot edit a record in Purchase lines history (PurchLineHistory). Update on a valid time state table is not allowed without specifying a ValidTimeStateUpdateMode.

67241.error.jpg

what could be the reason ?

need help.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    In general I'm very uncomfortable with renaming primary keys in tables. I guess that's what you were trying to do. As you can see, all kinds of issues can occur.

    The problem here is that the table in question is a "valid time state" controlled table (msdn.microsoft.com/.../gg861781.aspx). You can't update them as you can normal tables, instead you have to specify a ValidTimeStateUpdateMode. And it seems that the standard AX "rename primary key" functionality doesn't know how to handle this.

    In this case you would have to update the record with ValidTimeStateUpdateMode::Correction, which will update the existing record. I would suggest you just try to update it with a job. You will find instructions on how to implement it from the article that I linked.

    However if / when the whole primary key renaming has to happen in one transaction, it's a bit more tricky. One option could be the following:

    1) Change the batch id of the purchLine to some other batch id, which already exists in the system

    2) Rename your batch id

    3) Change the batch id of the purch line to the newly renamed batch id

    But you are doing this at your own risk. My suggestion is to never update the primary keys in the first place.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 3

#2
Mea_ Profile Picture

Mea_ 2

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans