onLookup in RTC Filter Problem

jimmyfjimmyf Member Posts: 104
edited 2012-12-19 in NAV Three Tier
I have a function which looks up the Item table on the onLookup trigger in a bespoke table I created.
The function allows the lookup on the classic client and the RTC.
The function filters on Inventory Posting Group, Item Category Code and conditionaly on a field called Price Band.

In the classic client the filter works perfectly however in the RTC the Filter does not it only filters on Inventory Posting Group!!
My code is below. I cannot see anything obvious.

recSetup.GET;

CLEAR(recItem);
recItem.SETRANGE("Inventory Posting Group",recSetup."Raw material Inv. Posting Grp.");
recItem.SETRANGE("Item Category Code",recSetup."Def. Item Category");

CASE pPriceBand OF
  'A' : recItem.SETRANGE("Price Band",'A');
  'B' : recItem.SETFILTER("Price Band",'%1|%2','A','B');
  'C' : recItem.SETFILTER("Price Band",'%1|%2|%3','A','B','C');
END;

IF ISSERVICETIER THEN BEGIN //If run from RTC..
    IF PAGE.RUNMODAL(0, recItem) = ACTION::LookupOK THEN BEGIN
       pCode := recItem."No.";
    END;
END ELSE BEGIN //If run from Classic..
    IF FORM.RUNMODAL(0, recItem) = ACTION::LookupOK THEN BEGIN
       pCode := recItem."No.";
    END;
END;

Comments

  • gandhi_nklgandhi_nkl Member Posts: 44
    Hi Jimmy,

    Please specify the page ID which you want you to Run.

    IF ISSERVICETIER THEN BEGIN //If run from RTC..
    IF PAGE.RUNMODAL(50000, recItem) = ACTION::LookupOK THEN BEGIN
    pCode := recItem."No.";
    END;
    END ELSE BEGIN //If run from Classic..
    IF FORM.RUNMODAL(0, recItem) = ACTION::LookupOK THEN BEGIN
    pCode := recItem."No.";
    END;
    END;

    Reason to give specific Page ID:

    Table does not have LookupPageID Property.
    Thanks & Regards,
    Muthu
  • jimmyfjimmyf Member Posts: 104
    Thanks Muthu
    I did as you suggested but unfortunately it still does not work.
    I used PageID of 31 which is Item List

    IF ISSERVICETIER THEN BEGIN //If run from RTC..
        IF PAGE.RUNMODAL(31, recItem) = ACTION::LookupOK THEN BEGIN
           pCode := recItem."No.";
        END;
    END ELSE BEGIN //If run from Classic..
        IF FORM.RUNMODAL(0, recItem) = ACTION::LookupOK THEN BEGIN
           pCode := recItem."No.";
        END;
    END;
    
Sign In or Register to comment.