Options

Invalid xRec contents

Steve_ContrisSteve_Contris Member Posts: 114
edited 2014-08-21 in NAV Three Tier
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?

Comments

  • Options
    jglathejglathe Member Posts: 639
    Interesting. Does this only happen when you are using RTC pages, or also with forms? Also, is there some code which does weird things to Rec, for example assigning a different record, maybe temporarily?

    with best regards

    Jens
  • Options
    Steve_ContrisSteve_Contris Member Posts: 114
    This only happens when using RTC. Sales orders created otherwise (import from web site) do not have this issue ever. I don't know if it would happen using forms. We are only using the RTC for any Sales order entry. I could try to see if it does but it is very random and difficult to replicate.

    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.
    What would Elvis do?
Sign In or Register to comment.