Thursday, December 29, 2011

Error trying to update record in Dynamics Ax

Strange error when trying to update a record in Dynamics Ax 2009. When trying to save a record a message like the following is showed:


Cannot edit a record in Projects (ProjTable).
An update conflict occurred due to another user process deleting the record or changing one or more fields in the record

In this case is the ProjTable but can be any table. The problem happen when the system was running an instruction like update_recordset.

The solution was run a job using an instruction while select forupdate ....
Inside the while cycle and before start to modify the record values, i wrote the next instruction:

projTable.reread();

All the instruction was something like the following:

ttsbegin;
while select forupdate projTable...
...
{
    projTable.reread();
    .....
    projTable.update();
}
ttscommit;

After run the job the problem was solved and the process with the instruction update_recordset start to work again without problems.

I hope this can help to someone in a similar problem

Wednesday, February 16, 2011

the remote server returned an unexpected response: (405) method not allowed using WCF

When you're using WCF and try to check an *.svc file, you get an exception with the next messages:

"the remote server returned an unexpected response: (405) method not allowed ".

And if you try to check the file using IE, you get a http error with the code 404.3.

To solve this problems, run the following command:

C:\Windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg -i

With that, the problem has gone.