Another User Has Modified the record for this ...

anton1987anton1987 Member Posts: 35
edited 2009-06-02 in Navision Attain
Hi Im new to Navision Development.

I not to clue'd up with nav as yet and still getting used to the code but I have a slight problem

I get the following error and I dont know how stop it.

Another User has modified the record for this Sales Line after you retrived it from the database.

Enter your changes again in the updated fields windows, or start the interupted activity again.

Identificatin Fields and Values


Here is what I did that caused the error.

I created two sub froms for the sales invoice line.

I the added the the two sub forms called sub form 1 witch is the one I created and sub form 2 which is the on created by microsoft.

I added my sub form one to a tab in the sales invoice form.
And everythime I change values on sub form 1 they change in sub form two but the error occurs when I click on the next line in the sales line sub form in the sales invoice form.

Could anyone help please

Comments

  • byllebylle Member Posts: 47
    Hi

    You are recieving this error because you are handling the same record in two different forms. What Navision does, it to load one recordset into sub 1 and then again one recordset into sub 2. If you are now changes anything in sub 1 - then you make changes to the first recordset - when you then afterwards wants to do changes in sub 2, then the loaded recordset is no more the actual recordset but an "old" version of it. Therefor you are getting the error "Another user has modified...."

    What you can do, is to make sure that changes are committed and then load the newest recordset again. Try also using CurrForm.Update and SELECTLATESTVERSION.
  • anton1987anton1987 Member Posts: 35
    Hi

    Thanks So much fro all the help.
  • DenSterDenSter Member Posts: 8,307
    It really comes down to technical design, and properly passing variables. It happens a lot that a record is modified by another object, either by value or by just passing key values and the other object retrieves the same record from the database, and when the scope returns the calling object tries to modify it again. Instead of adding all these statements to the code, the best solution is to analyze your code and see where this happens and make sure you pass the original record into the other object by reference. If that is not possible (say when you are using functions in standard objects and you don't want to mess around with that), THEN you think about doing GETLATESTVERSION or retrieving the record again.
Sign In or Register to comment.