Running on old code?

This question is concerning NAV 2009.

I have a form that calls a "Processing Only" report. The report calls a codeunit.

My customer has reported an error. I can reproduce the error again and again by pressing a button in the form.

If I add messages in the codeunit, I can still reproduce the error, but I don't get the messages.

If I add messages in the report, I get the messages from the report and the messages from the codeunit, but I cannot reproduce the error.

Am I running on old code in the report until I add messages in it?

Is there a difference between F11 (Compile) in the Object Designer without opening the object, and when I add a message and save and compile the report?

(My customer and a former colleague has told, that my customer now and then has to press F11 in the Object Designer in order to make this part of NAV work. Until now I haven't heard why this should be necessary.)

I hope someone can help me. I'm quite new to NAV.

Best Answer

  • MortenSteengaardMortenSteengaard Posts: 22
    Accepted Answer
    Hi everybody.

    Thank you very much for your reply!

    Now I have learned that the report didn't change behaviour because it ran on old code and later on on new code. The problem was that the same report was used with a user-made filter running on many objects, and the report was also used on a single object in another form. The problem was that when I first run on many objects with a specific filter, that filter is saved and used when I run the same report from the form with the single object. And then it acts very weird.

    And when I then compile the report, NAV deletes the old user-made filter on that report. And that makes the report change behaviour, so it works correct on the form with only one object.

    Once again, thank you very much!

Answers

  • HatchetHarryHatchetHarry Posts: 11Member
    what is the error?
  • Remco_ReinkingRemco_Reinking Posts: 71Member
    The error comes before the messages?
  • MortenSteengaardMortenSteengaard Posts: 22Member
    The error is not important. It is some business logic, that give some fields in the database the wrong values. The error is not an error message. The problem is that when I add messages, it seems to me that I suddenly run on different code.

    I can do this:
    - Restore the database from the customer on our own server.
    - Reproduce the error, so some fields get the wrong values.

    That is fine, but then I have to add messages to understand the code.

    So I do this:
    - Restore the database from the customer on our own server.
    - Change license file temporarily so I have developer rights.
    - Add one message in the report.
    - Save and compile the report.
    - Open a new NAV.

    Then my message is shown, but I cannot reproduce the error.

    It seems to me that before I add my message, NAV is running on an old version of the report and the codeunit. And just because I add my message somewhere in the report, NAV is running on the new version.
  • MortenSteengaardMortenSteengaard Posts: 22Member
    Accepted Answer
    Hi everybody.

    Thank you very much for your reply!

    Now I have learned that the report didn't change behaviour because it ran on old code and later on on new code. The problem was that the same report was used with a user-made filter running on many objects, and the report was also used on a single object in another form. The problem was that when I first run on many objects with a specific filter, that filter is saved and used when I run the same report from the form with the single object. And then it acts very weird.

    And when I then compile the report, NAV deletes the old user-made filter on that report. And that makes the report change behaviour, so it works correct on the form with only one object.

    Once again, thank you very much!
Sign In or Register to comment.