How to add filters to default Lookup Filter?

selece28selece28 Member Posts: 316
Hi Nav masters,
I have a problems, my client want me separate their Sales Order process,
So i make a new Sales Order Form from the original one. In example call it Sales Order Retail. But my problem is in this SO i want the system to only lookup Item with specific Product Type. Can i add filter to the lookup table without changing the current Lookup Property in Sales Line."No." ?

Any Suggestion?
Thanks in advance
______________

Regards,
Steven

Answers

  • garakgarak Member Posts: 3,263
    If your subform is also a new form, you can use the OnLookup Trigger of the field "No." in subform.

    example
    No. - OnLookup(VAR Text : Text[1024];) : Boolean
    case Type of
      Type::Item:
         begin
           Item.reset;
           Item.setfilter("No.","No."); //if an item No is inserted
           Item.setfilter("Somefield",FilterCondition);
           if form.runmodal(0,Item) = Action::LookupOK then
             "No." := Item."No.";
         end;
      Type::Resource:; //Here the code for resources 
      //Also for the other Types
    

    Regards
    Do you make it right, it works too!
  • selece28selece28 Member Posts: 316
    Yes my subform is also a new subform. But i want to use the same lookup form.
    I will try this first.

    It worked. I just know that code in Sales Line form will replace the lookup property.

    Thanks a lot garak :)
    ______________

    Regards,
    Steven
Sign In or Register to comment.