Filter from a field

hunterhunter Member Posts: 19
I have a little problem, this is the situation

i have the table "Item" and i have the field "code" type of code[20]
and storage a value like this example: 21062002

i have other table "details" with this fields
clasification type of code[4]
codeitem type of code [20]

so the situation is, i would like to do that when the clasification field have the value 2106 in the other field "codeitem" filter only the products that start with 2106* and not all products, its posible? how can i do that...

i try with TableRelation but i not have a clear idea

thanks for your help :(

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    If you add a new field to the itemtable that contains the ID [4] field and populate this by code you can make a tablerelation.

    You can also program a lookup in the second table instead of making a tablerelation.
  • andreofandreof Member Posts: 133
    Use this on the onlookup event in table "Details" field "CodeItem":

    REC_Item.SETFILTER(No.,'%1',"Type" + '*');

    IF FORM.RUNMODAL(0,REC_Item) THEN BEGIN
    CodeItem := REC_Item."No.";
    END;
    Andre Fidalgo
    My world: Dynamics NAV,SQL and .NET

    CEO at Solving Dynamics
    http://www.solvingdynamics.com
  • hunterhunter Member Posts: 19
    Thanks andreof
    Perfect!! \:D/
    recItem.SETFILTER(recItem."No.",Clasificacion+'*');
    IF FORM.RUNMODAL(0,recItem)=ACTION::LookupOK THEN BEGIN
       "No.":= recItem."No.";
    END;
    
Sign In or Register to comment.