Is it possible to alter the lookup behavior behind a quickfilter in NAV '13 R2?

1.5k views Asked by At

Perhaps this is simply a matter of not completely understanding the Lookup Triggers on tables and pages...

When we perform an item lookup from the quickfilter box on the Item List page, I want to take the input and modify it with certain wildcards like so:

NewLookup := CONVERTSTR(OriginalLookup, '-', '*');
NewLookup := OriginalLookup + '|' + NewLookup;

... From what I can tell so far, the OnLookup triggers don't fire when performing a quickfilter... at least, I've put code in the onlookup triggers for both the table and the page, without actually performing a lookup action in either case, and the quickfilter will still return results which, so far as I understand, shouldn't happen if I haven't handled all aspects of the lookup myself.

So:

  1. Is it possible to modify the behavior of the lookup behind a quickfilter in C/AL?
  2. If so, where do I do that? Am I just using the OnLookup trigger wrong and it's just a matter of getting it right, or do I have to go somewhere else?
1

There are 1 answers

2
Alexander Drogin On

Quick Filter in Nav is that edit box on the right side of the page with "Type to filter" inside. It doesn't have any lookups. It accepts only plain text values or some 'macro' filters as described on MSDN.

  1. Unfortunately, it is impossible to modify behavior of filter lookups in RTC as it has been in the classic client. Role-tailored client just doesn't invoke C/AL triggers.

  2. You are using OnLookup trigger correctly, but it is only called when you click on lookup button in the page field, not in the filters tab.

After you build your filter value. you can apply this filter SETFILTER(LookupField,NewLookup); And it will be displayed in the 'Advanced filters' pane, still lookup from this field only takes into account the field's TableRelation property, OnLookup trigger is ignored.