Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Filter on account sele...
Finance forum
Unanswered

Filter on account selection

Posted on by
Hi,
 
I have a requirement where I have a parameter form with a field called "FilterAccountValues" having multiselect lookup seperated by commas, lets say the filter values are:
FilterAccountValues : A-001,C-002,M-001,311
 
Now when i navigate to "View Trade Agreements" screen from either customers or release products then i should see only the trade agreement with Account selection as FilterAccountValues. i.e. In the account selection field only the values with account selection A-001,C-002,M-001,311 should be displayed.
I tried writing code on PricediscTable formdatasource priceDiscTable - executeQuery()
I have written below x++ code to achieve this but the highlighted line throws object reference error, can someone please help me with this.

        QueryBuildDataSource    qbds;
        QueryBuildRange         qbr;
        int                     conI = 1;
        container               accountSelectionCon;

            container    accountSelection = str2con(parameterTable.FilterAccountValues);
            ListIterator accountSelectionList = new ListIterator(con2List(accountSelection));
            while(accountSelectionList.more())
            {
                conI++;
                accountSelectionCon = conIns(accountSelectionCon, conI, accountSelectionList.value());
                accountSelectionList.next();
            }
            qbds = this.query().dataSourceTable(tablenum(PriceDiscTable));
            qbr = qbds.addRange(fieldnum(PriceDiscTable, AccountRelation));
            qbr.value(con2Str(accountSelectionCon));
 
Thanks in advance.
 

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

Dynamics 365 Community Update – Sep 16th

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…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,334 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans