We are running Navision 2009 with SQL database in a 3-tier installation.
I was researching an issue where sales orders would end up with line items that had a Qty. to Ship of 0. Without the Qty to Ship the orders wont post. These are not hard to fix - basically just change the Quantity to something different and then change it back to the original value and that populates the Qty. to Ship as it should have in the first place.
This only happens sporadically and has been difficult to diagnose so I added some messages in the OnValidate trigger of the Quantity field. Eventually,using these "debug" messages I was able to see that the reason the Qty. to Ship was not populated was that the xRec that was being used for comparison of the Quantity field in the Quantity OnValidate trigger contained the Quantity and all other data from some other line on the order. This caused the initialization of the Qty. to Ship to be skipped. This is happening on multiple computers, multiple users, multiple items and even resources - no pattern that I can see. Instead of containing a copy of the current line being edited, the xRec sometimes contains the line above the current line being edited, but most often it contains the first line item on the order. All of the OnValidate triggers for the line will "see" this invalid xRec until the editing is done. I cannot find any references to anyone having this particular issue with xRec. Everything I read tells me that this xRec should be filled out behind the scenes automatically but it seems that is failing in some random cases. Very puzzling.
What would Elvis do?
0
Comments
with best regards
Jens
There is no code that is doing anything at all with assignment of the xRec. All there is in the Sales Line table code are comparisons to various xRec values in various onValidate triggers and so on. xRec is not assigned or copied or anything like that.