Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Filter

Posted on by 3,027

Hi

  In a report on request Page i have dropdown with options Import,Export,Others. On request Page there is another field. If Import is selected i want in second field only those Vendor's List should be displayed whose Gen Bus Posting Group is Import. If Export is selected in first variable then only those Vendor's List should be displayed whose Gen Bus Posting Group is Export.

Thanks

*This post is locked for comments

  • Suggested answer
    Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: Filter

    @jsshivalik,

    Hm. I explained how to do it earlier and you got the info, I hope. What's your problem for now?

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Filter

    Hi

     In CustNo i want to display list on the basis of selection .

    Thanks

  • Suggested answer
    Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: Filter

    @jsshivalik,

    Honestly speaking, you created full mess with your code. I understand nothing. :)

    DataType is property of field or variable, and it says what is type of data to store in this field. For customer code you should use Code[20].

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Filter

    Hi

     Sorry for that . CustNo is defined on Request Page. In this field List will be displayed. How it should be used. What should be its DataType.

    CustType is actually Gen Bus Posting Group.

    Thanks

  • Suggested answer
    Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: Filter

    @jsshivalik,

    First you told about Vendor, now you show customer-related customization. What is your problem? What is CustNo table? What is "Customer Type" field? What does DataType do in your customization?

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Filter

    Hi

       I have written like this but it is giving error

    The Customer has an Invalid DataType Record. The Valid DataTypes are Byte;Integer;Text;Code;

    Customer - OnLookup(VAR Text : Text) : Boolean
    Case CustomerType of

     CustomerType::Import : CustNo.setrange("Customer Type", "Import");
     CustpmerType::Export : CustNo.setrange("Customer Type", "Export");

    end;

    CustNo is of Record DataType.

    Thanks

  • Suggested answer
    Rafael B. Profile Picture
    Rafael B. 715 on at
    RE: Filter

    Hi @jsshivalik,

    That's not a problem. As I suggest you option field is a global variavle. So all you need is to show related vendors only using OnLookup trigger of the second field depending on option field's value, . E.g.:

    Vendor.reset;

    Case Field1 of

     Field1::Import: Vendor.setrange("Gen Bus Posting Group", GenBusPostingGroup1Code);

     Field1::Export: Vendor.setrange("Gen Bus Posting Group", GenBusPostingGroup2Code);

     Field1::Others: Vendor.setrange("Gen Bus Posting Group", GenBusPostingGroup3Code);

    end;

    if page.runmodal(0, Vendor) = action::lookupok then

     Field2 := Vendor."No.";

    If you have huge list of vendors than you should also use SETCURRENTKEY to change sorting to make table work faster.

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Filter

    Why do you need two fields? Why don't you just allow the selection of those Gen Bus Posting Groups?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans