Help me to sort out this problem

manishkutarmanishkutar Member Posts: 19
I have one issue which I requires in my report.
I one data item with ReqFilterItem -> 'Document No.' and I also have one MenuField in RequestForm -> 'Vendor Bank Code'
Now I require is whenever user selects 'Document No.' and then goes to RequestForm to select 'Vendor Bank Code' then they should get list related to that Document No. Whole list of 'Vendor Bank Code' should not be displayed.
Please resolve this issue soon.
Thanx in advance.

Manish Kutar,
Senior Technical Consultant
manishkutar@gmail.com

Answers

  • vijay_gvijay_g Member Posts: 884
    You need to keep "Document No." on RequestForm.
  • manishkutarmanishkutar Member Posts: 19
    vijay_g wrote:
    You need to keep "Document No." on RequestForm.

    I tried a lot but couldnt make it. I cant recognise where to write the code. I mean where to have filter for getting limited list in Vendor Bank Code. Or can you send me sample object for that.

    Manish Kutar,
    Senior Technical Consultant
    manishkutar@gmail.com
  • stanpstanp Member, Microsoft Employee Posts: 13
    There are plenty of samples how to do conditional lookup in the Application code.
    Search in all reports for statements like this:
    IF FORM.RUNMODAL(0,SomeRec) = ACTION::LookupOK THEN
    
    or
    SomeForm.SETTABLEVIEW(SomeRec); 
    IF SomeForm.RUNMODAL = ACTION::LookupOK THEN
    
    There you can see that it is usually called from OnLookup trigger of some control.
    SomeRec:record may have filters which you need to set above and then in a lookup form you will see filtered records.
    Stan Pesotskiy
    Senior SDE - Dynamics Nav Application - Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • abhinav0408abhinav0408 Member Posts: 35
    Just make 2 text box, One is for Doc No. and other is for Vendor Bank Code.
    and write Code on Lookup trigger of Doc No.
    IF FORM.RUNMODAL(0,Rec) = ACTION::LookupOK THEN begin
    DocNo := Rec.Document No.;
    VendNo. :=Rec.Buy From Vendor No. ;
    end;

    Now write code on OnActivate and OnLookup trigger of Vendor Bank Code text box
    OnActivate()
    recVendBank.RESET;
    recVendBank.SETRANGE(recVendBank."Vendor No",VendNo);
    if recVendBank.FINDSET then
    recVendBank.FILTERGROUP(2);
    and same Onlookup Code for Vender Bank Code

    This will solve your Prob.
  • manishkutarmanishkutar Member Posts: 19
    Thanx Abhinav and Stanp.. It helped me alot..

    Manish Kutar,
    Senior Technical Consultant
    manishkutar@gmail.com
Sign In or Register to comment.