Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

How to make a drop-down grid selection?

Posted on by 135

Hello sirs, I want to imitate this dropdown box with a grid selection
PICS.png

Can anyone give me an idea how to do this?

Thanks again.

  • Sean The Michael Profile Picture
    Sean The Michael 135 on at
    RE: How to make a drop-down grid selection?

    Thank you for the suggestions everybody, it worked.

  • Suggested answer
    Israel Gonzalez Profile Picture
    Israel Gonzalez 708 on at
    RE: How to make a drop-down grid selection?

    Just add the field that you want to drop down and set EDT (VendAccount) and that's it.

  • Verified answer
    AXTechie2120 Profile Picture
    AXTechie2120 560 on at
    RE: How to make a drop-down grid selection?

    Hi,

    I think the fields vendaccountnum and name are from same tables .

    Please try the below code.

    Please create a stringedit field in your form and overwrite the lookup method for that field and you will able to get the desired output.

    public void lookup()

    {

    Query query = new Query();

    QueryBuildDataSource qbds;

    QueryBuildDataSource QbdsJoin;

    SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(PurchTable), this);

    ;

    super();

    qbds = query.addDataSource(tableNum(PurchTable));

    sysTableLookup.parmQuery(query);

    sysTableLookup.addLookupfield(fieldNum(PurchTable, OrderAccount));

    sysTableLookup.addLookupfield(fieldNum(PurchTable, PurchName));

    sysTableLookup.performFormLookup();

    }

    Please mark the answer verified if found useful.

    Regards,

  • Verified answer
    AXTechie2120 Profile Picture
    AXTechie2120 560 on at
    RE: How to make a drop-down grid selection?

    Hi,

    public void lookup()

    {

    //super();

    // Declaration

    Query   LookupQuery    =   new Query();

    QueryBuildDataSource     LookupQueryBuildDataSource;

    QueryBuildRange                  LookupQueryBuildRange;

    SysTableLookup CustomSysTableLookup =       SysTableLookup::newParameters(tableNum(CustTable), this);

    ;

    // Add fields that you want in Lookups

    CustomSysTableLookup.addLookupField(fieldNum(CustTable, AccountNum));

    CustomSysTableLookup.addLookupField(fieldNum(CustTable,Currency));

    LookupQueryBuildDataSource =

    LookupQuery.addDataSource(tableNum(CustTable));

    LookupQueryBuildRange=

    LookupQueryBuildDataSource.addRange(fieldNum(CustTable,AccountNum));

    //LookupQueryBuildRange.value(queryValue(NOYESCOMBO::Yes));

    // Execute the Query

    CustomSysTableLookup.parmQuery(LookupQuery);

    CustomSysTableLookup.performFormLookup();

    }

    Please try the above code.

    Any modify according to your needs.

    Regards,

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,126 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans