So I’ve made this big customization to Quote Entry which primarily keeps quantity values consistent between QuoteDtl.OrderQty, QuoteDtl.SellingExpectedQty, and QuoteQty.SellingQuantity. In the test database I had this working very smoothly with no errors-- you could change the OrderQty value over and over, and it would quietly set the other two quantities to the same value without error. In the Live database however, changing the OrderQty consistently returns a “Row has been modified by another user” error.
I have seen that the SellingExpQty field can cause this error if you forget to add a oTrans.Update(); line after modifying its value, but I’ve got that base covered in my code. Also worth noting in the error message:
The error seems to occur when I set the QuoteQty.SellingQuantity field to match the new OrderQty value. This did not happen in the test database, and I do not understand why it’s happening here.
Here’s the code that fires when OrderQty’s value is changed:
Try this first. If problem still happens add code below.
Also the row modified thing is happening because another user other than the one logged in is modifying the row. after your update you can try running
Next add a notify and refresh to help with rowmod issues. So make it look like this:
edvQuoteDtl.CurrentDataRow[“SellingExpectedQty”] = (decimal)edvQuoteDtl.CurrentDataRow[“OrderQty”]; edvQuoteQty.CurrentDataRow[“SellingQuantity”] = (decimal)edvQuoteDtl.CurrentDataRow[“OrderQty”];
oTrans.Update();
oTrans.NotifyAll(); or oTrans.NotifyAll(true); (Depends on the form)
oTrans.Refresh();
Hmmmm it appears to be working now, I think. I added oTrans.NotifyAll(); and oTrans.Refresh(); after oTrans.Update(); and kept the Update(); line at the bottom (that second instance in my first post was mostly added out of desperation ) Now there’s no errors! Hopefully it’s stable now-- I thought I already fixed this last week.