web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

multiselection lookup not showing all values

(0) ShareShare
ReportReport
Posted on by 1,836

I have tried creating multiselect lookup on my ssrs report but its not getting all the values as required but when i remove multiselection code all the values are visible can anybody suggest me what should i do to get all valeus in multiselection lookup.

I have the same question (0)
  • GirishS Profile Picture
    27,827 Moderator on at
    RE: multiselection lookup not showing all values

    Hi Dinesh,

    Your question is not clear.

    Can you elaborate?

    Thanks,

    Girish S.

  • Dineshkarlekar Profile Picture
    1,836 on at
    RE: multiselection lookup not showing all values

    here in lookup bank group should contain 4 values but it is showing 2 values 

    pastedimage1685434588628v2.png

    [DataContractAttribute,
    SysOperationContractProcessingAttribute(classStr(DTBankDailyBalanceUIBuilder))]
    public class DTBankDailyBalanceDC
    {
        TransDate	fromDate,toDate;
        List        dataAreaID;
        List   bankGroupId;
    
    
        [DataMemberAttribute("Branch"),
            AifCollectionTypeAttribute('Branch', Types::String),SysOperationLabelAttribute(literalstr("Branch")),
            SysOperationDisplayOrderAttribute('1')]        
        public List ParmBranch(List _Branch = DataAreaId)
        {
            DataAreaId = _Branch;
            return DataAreaId;
    
        }
    
        [DataMemberAttribute("BankGroup"),
            AifCollectionTypeAttribute('BankGroup', Types::String),SysOperationLabelAttribute(literalstr("BankGroup")),
            SysOperationDisplayOrderAttribute('2')]
        public List ParmBankGroupId(List _bankGroupId = BankGroupId)
        {
            BankGroupId = _bankGroupId;
            return BankGroupId;
    
        }
    
        [DataMemberAttribute("FromDate"),SysOperationLabelAttribute(literalstr("From Date")),
            SysOperationDisplayOrderAttribute('3')]
        public TransDate ParmfromDate(TransDate _fromDate = fromDate)
        {
            fromDate = _fromDate;
            return fromDate;
    
        }
    
        [DataMemberAttribute("ToDate"),SysOperationLabelAttribute(literalstr("To Date")),
            SysOperationDisplayOrderAttribute('4')]
        public TransDate ParmtoDate(TransDate _toDate = toDate)
        {
            toDate = _toDate;
            return toDate;
    
        }
    
    }

    public class DTBankDailyBalanceUIBuilder extends SysOperationAutomaticUIBuilder
    {
        DTBankDailyBalanceDC    contract;
        DialogField             dlgBrach,dlgFromdate,dlgTodate,dlgbankGroupId;
        DataAreaId              dataAreaid;
        
        public void build()
        {
            contract                = this.dataContractObject();
            dlgBrach                = this.addDialogField(methodStr(DTBankDailyBalanceDC,ParmBranch), contract);
            dlgFromdate             = this.addDialogField(methodStr(DTBankDailyBalanceDC,ParmfromDate), contract);
            dlgTodate               = this.addDialogField(methodStr(DTBankDailyBalanceDC,ParmtoDate), contract);
            dlgbankGroupId          = this.addDialogField(methodStr(DTBankDailyBalanceDC,ParmBankGroupId),contract);
        }
    
        private void branchIdLookup(FormStringControl _control)
        {
            ListEnumerator enum;
            Query query = new query();
            QueryBuildDataSource queryBuildDataSource;
            queryBuildDataSource = query.addDataSource(tableNum(DataArea));
            queryBuildDataSource.fields().dynamic(false);
            queryBuildDataSource.fields().clearFieldList();
            queryBuildDataSource.addSelectionField(fieldNum(DataArea,id));
            queryBuildDataSource.addSelectionField(fieldNum(DataArea,name));
            
            SysLookupMultiSelectGrid::lookup(query,_control, _control, _control, conNull());
            if (_control.valueStr() != '')
            {
                dataAreaid = _control.valuestr();
            }
        }
    
        private void bankGroupIdLookup(FormStringControl _control)
        {
            ListEnumerator enum;
            Query query = new query();
            QueryBuildDataSource queryBuildDataSource;
            queryBuildDataSource = query.addDataSource(tableNum(BankAccountTable));
            queryBuildDataSource.fields().dynamic(false);
            queryBuildDataSource.fields().clearFieldList();
            queryBuildDataSource.addSelectionField(fieldNum(BankAccountTable,BankGroupId));
            //queryBuildDataSource.orderMode(OrderMode::GroupBy);
            queryBuildDataSource.addGroupByField(fieldNum(BankAccountTable, BankGroupId));
    
            SysLookupMultiSelectGrid::lookup(query,_control, _control, _control, conNull());
            
        }
    
        public void postBuild()
        {
            super();
            contract        = this.dataContractObject();
            dlgBrach        = this.bindInfo().getDialogField(contract, methodStr(DTBankDailyBalanceDC,ParmBranch));
            dlgBrach.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(DTBankDailyBalanceUIBuilder,branchIdLookup), this);
    
            dlgbankGroupId       = this.bindInfo().getDialogField(contract, methodStr(DTBankDailyBalanceDC,ParmBankGroupId ));
            dlgbankGroupId.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(DTBankDailyBalanceUIBuilder,bankGroupIdLookup ), this);
           
        }
    
        public void postRun()
        {
        }
    
    }

     I want it to show all 4 of these , can you please tell me, how can i get it done.

    thanks

    regards 

    Dinesh

  • GirishS Profile Picture
    27,827 Moderator on at
    RE: multiselection lookup not showing all values

    May be the issue with the group by restricted the record to show only 2 records. Is BankGroupId field in BankAccountTable is standalone field or its coming from some other table? Check the relations node.

    If it's coming from some other table, you can use that table in the query instead of adding BankAccountTable and adding group by.

    Thanks,

    Girish S.

  • Dineshkarlekar Profile Picture
    1,836 on at
    RE: multiselection lookup not showing all values

    the field is coming from bank account table , as soon as i remove the group by field it started showing multiple/ repeated  results in lookup , but only 2 names are repeating, loan and current account is not there 

      

  • GirishS Profile Picture
    27,827 Moderator on at
    RE: multiselection lookup not showing all values

    Seems BankAccountTavle doesnt have values other then savings and deposit bank Group id.

    Open the BankAccountTable in table browser and see.

    Thanks,

    Girish S.

  • GirishS Profile Picture
    27,827 Moderator on at
    RE: multiselection lookup not showing all values

    Also, there is BankGroup table where bank group id is coming from. Use that table in the lookup query instead of BankAccountTable.

    Thanks,

    Girish S.

  • Dineshkarlekar Profile Picture
    1,836 on at
    RE: multiselection lookup not showing all values

    hi 

    thanks 

    Girishs

    now i am getting all values in lookup do i have to mension join  bankaccounttable to bankgroup in lookup query , below query i am using in dp class 

    while select bankAccountTable
    where bankAccountTable.BankGroupId == _bankGroupIdValue

    here is lookup method in ui builder class , do i need to join bank account table to bankgroup in one of these or both.

     private void bankGroupIdLookup(FormStringControl _control)
        {
            ListEnumerator enum;
            Query query = new query();
            QueryBuildDataSource queryBuildDataSource;
            queryBuildDataSource = query.addDataSource(tableNum(BankGroup));
            queryBuildDataSource.fields().dynamic(false);
            queryBuildDataSource.fields().clearFieldList();
            queryBuildDataSource.addSelectionField(fieldNum(BankGroup, BankGroupId));
            
    
            SysLookupMultiSelectGrid::lookup(query,_control, _control, _control, conNull());
    
        }

    thanks 

    regards 

    Dinesh

  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at
    RE: multiselection lookup not showing all values

    It's a multiselect lookup so you need to use List type parm method in the contract class - On the dp class you need to loop through the list and add range using queryRangeConcat.

    Also you need to use query instead of while select statement. 

    List bankGroup;
    ListEnumerator bankGroupEnumerator;
    bankGroup = contract.parmBankGroup;// parmBankGroup must have return type as list
    //add the query here for bank account table.
    if(bankGroup)
    {
        qbr = qbds.addRange(fieldnum(BankAccountTable,BankGroupId));
        bankGroupEnumerator = bankGroup.getEnumerator();
    
        while(bankGroupEnumerator.moveNext())
        {
            qbr.value(queryRangeConcat(qbr.value(),bankGroupEnumerator.current()));
    
        }
    }
    
    //finally add query run to loop through the records and insert into temp table.

    Thanks,

    Girish S.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans