Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Lock the Record

Posted on by 362

Hi All,

I have a requirement to lock the same record when it is selected by other User. I mean When a user is trying to Adjust one Project Record, and when the Other user is trying to adjust the same Project, he should get error.I see that the Form data source  is a InMemory Table. I think it is very much similar to Journal Lock.Could you please help me in cracking the challenge.

Regards

H Venky

*This post is locked for comments

  • Suggested answer
    Fedir Kryvyi Profile Picture
    Fedir Kryvyi 1,026 on at
    RE: Lock the Record

    So if we are talking about ProjTable related data, I would add a new UserId based field in table, something like inUseByUser. Lets say your user1 selects some record, this record is InMemory record and it was populated from ProjTable - then you need to update inUseByUser field in ProjTable with currUserId and make your record editable. As soon as this record is unselected, or user closes form, you need to clean up that field. In case second user opens the same form and selects the same record, your logic should validate projTable.inUseByUser() value, if it is not empty, record should be made editable.

    Ideally, I wouldn't suggest to add inUseByUser. Instea, you can create your new table like projInUse, with two field ProjId and UserId. That should be faster compared to updating field in ProjTable. + you can cleanUp records from that table instead of cleaning up user value.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Lock the Record in AX 7

    This is a bad idea. There is a record version control. The first who saves the record wins; the other already gets an error then. That is how standard AX is working. How many times a day do you update the same project record?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans