Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Another user has modified the record Error from WebService

Posted on by 515

I just tested it and I do get the error.

Code: Select all

Another user has modified the record for this Item after you retrieved it from the database.  Enter your changes again in the updated window, or start the interrupted activity again.  Identification fields and values:  No.='1000'

From webservice.

My test codeunit looked like this.

Code: Select all

Item.GET('1000');

SLEEP(10000);

Item.VALIDATE(Description,'Bicycle WS');

Item.MODIFY;

So while the WS was waiting I modified the description on the item with another client.

*This post is locked for comments

  • Verified answer
    Jens Glathe Profile Picture
    Jens Glathe 6,092 on at
    RE: Another user has modified the record Error from WebService

    Hi Mouli,

    yes that's correct. While the WS process was waiting on sleep your item record became outdated from the modification of the other process. That's how it should work. If you want to grant exclusive access to the WS, then you need to lock the item table. And, depending of the context (WS with a page and a codeunit), you may also need a SELECTLATESTVERSION to get the current version of the records. The WS code should look like this:

    SELECTLATESTVERSION;

    Item.LOCKTABLE;

    Item.GET('1000');

    SLEEP(10000);

    Item.VALIDATE(Description,'Bicycle WS');

    Item.MODIFY;

    This code will only execute when LOCKTABLE() succeeds. But that's the point :)

    with best regards

    Jens

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans