How to Do it in Request Form OF Report

tejateja Member Posts: 78
Hi Experts,

I am using two text boxes in the Request Form. VAR1 and VAR2 of Code type variables. For the VAR1 the table Relation is given as Item , the user will select the ITem No. here. In the Second variable I want to show the variants of that particular Item, when the user clicks LoopUp button.

I am strucked here. Please help in solving this Issue..

Regards
Teja

Answers

  • DaveTDaveT Member Posts: 1,039
    Hi Teja,

    You will need to add code in the onlookup trigger on the second textbox. Create a variable of datatype record for the variant and filter it down to the item selected. Then call the lookup form in code. Look at form 7002 sales prices for an example.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    In your VAR2 - OnLookup(VAR Text : Text[1024];) : Boolean



    ItemVariantRec --- Record --- Item Variant
    ItemVariantFrm --- Form --- Item Variants
       ItemVariantRec.RESET;
       ItemVariantRec.SETRANGE(ItemVariantRec."Item No.",VAR1);
       IF ItemVariantRec.FINDSET THEN BEGIN
         ItemVariantFrm.SETTABLEVIEW(ItemVariantRec);
         ItemVariantFrm.LOOKUPMODE(TRUE);
         IF ItemVariantFrm.RUNMODAL = ACTION::LookupOK THEN BEGIN
           ItemVariantFrm.GETRECORD(ItemVariantRec);
           VAR2 := ItemVariantRec.Code;
         END;
         CLEAR(ItemVariantFrm); 
       END
       ELSE
         MESSAGE('No Variant exists for the entered Item - %1  ',VAR1);
    
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • tejateja Member Posts: 78
    Hi DaveT,

    Thanks For Your Reply. Its Working.. Thank u very much


    Regards
    Teja
  • DaveTDaveT Member Posts: 1,039
    Glad to help :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • tejateja Member Posts: 78
    Hi Sandeep Prajapati,


    Thanks For Your reply.. Its Working .. Thank U very Much


    Regards
    Teja
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    ..... :P
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
Sign In or Register to comment.