Options

Scrolling through Purchase Invoices - weird behaviour

mel_sadekmel_sadek Member Posts: 23
Hi all,

I am getting some bizarre behaviour from the Purchase Invoice document. Here's what's happening:

Say I have 2 Purchase Invoices, and I want to create a third. I press F3, and get a new record. I press TAB to automatically get a new document number.

1) Now, if I try to scroll backward to retrieve the previous record by clicking the Previous button on the toolbar, it works well.

2) Now, what if I want to get retrieve the first purchase invoice in my list (remember, I originally had 2, now I have 3) ? Obviously, again I click the Previous button. However, nothing happens! What do I do?

3) I try something else: I click the First button on the toolbar, and lo and behold it takes me to the first record. Now, I want to go back to my SECOND record (the one I was just one before clicking First). Instead of taking me to the desired record, it takes me to a new record (named 'untitled').

4) I click Previous, and it takes me to the THIRD record, which is normal.

5) Now, I click Previous again, and it doesn't work! It does nothing, and it stays on the THIRD record.

6) Clicking First takes me to the FIRST record in my list, however now the only way to access that lost SECOND record is by choosing it from F5.

I put breakpoints everywhere on the form, and I realized that when I click the Previous button in Step 5, NOTHING IS FIRED. It's like an unattached event.

Something is screwy here, as all other cards and documents can be navigated with these buttons just fine, except for the Purchase Invoices.

Can anyone shed some light into this situation? I can provide more help if needed.

Thanks in advance.

Comments

  • krikikriki Member, Moderator Posts: 9,120
    -Check if your form uses the primary key.
    -Check if the numbers of the document are in the order you expect (launch the table to see the exact order without interference of something on the form).
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mel_sadekmel_sadek Member Posts: 23
    Kriki,

    - The documents use the primary key that was used by default with CRONUS, so I guess it's safe to say that it hasn't changed.

    - The document #s are as expected, meaning they are always getting larger.
  • krikikriki Member, Moderator Posts: 9,120
    Are you using SQL?
    It happens that SQL-buffering goes crazy. In this case if you open the table in design and close it without saving, the problem is fixed. (you can also logout and login)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mel_sadekmel_sadek Member Posts: 23
    It's using Navision Database Server. I really wish it was that easy. I'm just really concerned as to why those buttons up there are not working in all situations. I think that's the crux of the problem, but I haven't found any leads as to WHY it is happening.

    Just to let you know, this is not a virgin database. This is a customized database.
  • mel_sadekmel_sadek Member Posts: 23
    I was able to resolve the problem, but the solution was just as bizarre as the problem itself.

    There was commented code in the OnNextRecord() trigger, and ironically, I had to remove it for the trigger to fire off properly. So, does this trigger behave similarly to the OnLookup? In the sense that once there is ANY code in it (commented or otherwise), it will disable a default functionality?
  • girish.joshigirish.joshi Member Posts: 407
    export the object as text, then search on setrange and setfilter, and check to see if any filters are getting set through code.
  • kinekine Member Posts: 12,562
    mel_sadek wrote:
    I was able to resolve the problem, but the solution was just as bizarre as the problem itself.

    There was commented code in the OnNextRecord() trigger, and ironically, I had to remove it for the trigger to fire off properly. So, does this trigger behave similarly to the OnLookup? In the sense that once there is ANY code in it (commented or otherwise), it will disable a default functionality?

    Yes, if there is something (empty line, local variable etc.) the trigger is overriden with this user defined one and standard code is not called.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.