Find()-function, cancel search in table from code

Last post 11-20-2008 3:21 AM by DaveT. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-19-2008 4:46 AM

    Find()-function, cancel search in table from code

    When I run Find('-')-function with some filters set, Nav starts a search in that table. If it happens with a client open, I can just click cancel if i want to stop the search.

    I am trying to write code so that I can cancel a search based on a condition from the code. As example; after 10 seconds, if it hasn't found any records it should stop the search. The reason being that the code is run via NAS.

    Have anyone tried to do something similar?

  • 11-19-2008 7:47 AM In reply to

    • DaveT
    • Top 25 Contributor
    • Joined on 03-21-2008
    • Posts 51

    Re: Find()-function, cancel search in table from code

    Hi Jimmy,

    If you get getting the search dialog box then the find in not using the correct key. Using the correct key can hughly improve performance. Try using the SETCURRENTKEY function to see if this improves the search. Depending on you version you can use more efficent call such as FINDSET.

    Hope this helps

    Dave Treanor

    Dynamics Nav Add-ons
    www.simplydynamics.ie/Addons.html
  • 11-20-2008 3:04 AM In reply to

    Re: Re: Find()-function, cancel search in table from code

    You're right. I was using wrong keys for the filtering i do. I changed the key and got under 1 sec responses.

  • 11-20-2008 3:21 AM In reply to

    • DaveT
    • Top 25 Contributor
    • Joined on 03-21-2008
    • Posts 51

    Re: Re: Re: Find()-function, cancel search in table from code

    Great - Good work

    Dave Treanor

    Dynamics Nav Add-ons
    www.simplydynamics.ie/Addons.html
Page 1 of 1 (4 items)