Options

Data replication and "Another user has change...". error

navuser1navuser1 Member Posts: 1,329
Dear Sir,

I've written code in a table(Master) for data replication between companies(A,B,C,D) within a single database in NAV 2009. The table structure has a Composite PK, ReadyToUse(Boolean field) and Remarks[Text Field).

When User clicks ReadyToUse (TRUE) field the current record is being replicated through allover the companies.
[if 'Composite PK' is not found in any company then it will replicate/create the same record and if found then it modify the data accordingly.]

When User has changed the value to false in the field of ReadyToUse then current must have some value in the Remarks column otherwise it will give an error message & stop the process.

-- The code is working fine to this point without any issue.

But in a scenario where I have replicated a particular record with the remarks column value "1" from the Comapny A and after that I have changed the remarks value to 10 in the company C. Now if I try to change the value from TRUE to False of the field "ReadyToUse" in the company A (or any comapny) it will give the error message that "Another user has change...".

But when I have change the value 1 to 2 and then 2 to 1 in the comapny A (or any comapny) then it works fine without giving the "Another user has change...". error message.

Please address where is the problem. :shock:
Now or Never

Comments

  • Options
    manjusreemanjusree Member Posts: 79
    Hi,

    If different threads in the code modify your master table, then you must refresh the value of the record variable before you edit the record again. Otherwise, you get this error. Basically you should use GET to retrieve the record if you are modifying the record again. Hope this MSDN link will help you:-

    http://msdn.microsoft.com/en-us/library/dd355414.aspx

    You can also search the forum for this error. Multiple posts exist on the same.

    Regards,
    Manjusree
  • Options
    navuser1navuser1 Member Posts: 1,329
    I'm the only user working on that table(Master).

    I receive the error message when I try to change the Boolean value in Company A but the error message is occurred when the C/AL Code attempts to modify table data of other company(not A). The Code written only to modify/create the data to the other company not the current company where the user working.

    I close client application and then reopen the client to try again the same but still facing the same error message.

    MSDN link is good but not working for this case.

    EDITED:

    I'm always using a single session to open a company.
    Now or Never
  • Options
    manjusreemanjusree Member Posts: 79
    Hi,

    Are you including 'Remarks' column in your primary key?. You said it is composite primary key.

    Regards,
    Manjusree
  • Options
    navuser1navuser1 Member Posts: 1,329
    manjusree wrote:
    Hi,

    Are you including 'Remarks' column in your primary key?. You said it is composite primary key.

    Regards,
    Manjusree

    It's not included in pk.
    Now it's working fine after removing some wrong code.

    Thank you for your response. :thumbsup:
    Now or Never
  • Options
    navuser1navuser1 Member Posts: 1,329
    manjusree wrote:
    Hi,

    Are you including 'Remarks' column in your primary key?. You said it is composite primary key.

    Regards,
    Manjusree

    It's not included in pk.
    Now it's working fine after removing some wrong code.

    Thank you for response. :thumbsup:
    Now or Never
Sign In or Register to comment.