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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Another user has modified the record Error from WebService

(0) ShareShare
ReportReport
Posted on by 517

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

I have the same question (0)
  • Verified answer
    Jens Glathe Profile Picture
    6,092 on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans