Options

Filter Function

HayanHayan Member Posts: 110
Dear All,

Anybody can help on what is the function that gets called when you do a filter on the Filter Box in any list in NAV Client? I mean i am trying to write a code that is triggered when a user do a filter in the list page but i am not getting where is this function?
appreciate your help.

Best
HAYAN

Answers

  • Options
    neilgfneilgf Member Posts: 148
    Hayan, Hi. Not sure what you mean. Are you getting a user to confirm a filter and then you want to apply it to a table? If so, use a text global and then assign this using SETRANGE to a filter. Neil
  • Options
    HannesHolstHannesHolst Member Posts: 119
    Hi Hayan,

    it's not possible to access the filterbox in the upper right from a code-perspective.
  • Options
    HayanHayan Member Posts: 110
    @neilgf , Nup i think @HannesHolst understood me, i need to make a notification when a user searches for a customer and he didnt find it, the system will suggest creating this customer using a template, any body has passed into such an idea like this? if yes how did u manage to do it?
    Best
    HAYAN
  • Options
    HannesHolstHannesHolst Member Posts: 119
    edited 2017-03-01
    Hayan,

    That's not the normal approach in how to work with NAV.
    Normally, when you filter for a customer and the result is 0, the user should be able to push "New" on Customer-list.

    But, I know requests from clients :wink:
    You could do something like this in OnAfterGetRecord:
    IF (Rec.GETFILTERS <> '') AND (ISEMPTY) AND (NOT AlreadySuggested) THEN
      BEGIN
        // show template suggestion here
        AlreadySuggested := TRUE;
      END;
    

    I've inserted "AlreadySuggested" to avoid a loop in case the user doesn't want to create a customer using a template.
    Nevertheless, try to convince your client to stick to the standard approach.

    Cheers,
  • Options
    HayanHayan Member Posts: 110
    @HannesHolst HAHAHAH yes exactly, Some client as much as you try to convince them, they will not follow, they are just like this. :smile:
    Thank you for your advice, i will try to manage with the Above code.

    Best
    HAYAN
Sign In or Register to comment.