I have two problems.
(1) I am not getting names in the text box only numbers. I get recdId's. Below is just an example.
(2) My Rec Id list is not getting passed to the DP class.
Here's my code:
class DeductionClosedContract { List workerList; DataMemberAttribute('workerList'), AifCollectionTypeAttribute("_workerList", Types::Int64), AifCollectionTypeAttribute("return", Types::Int64) ] public List parmWorkerList(List _workerList = workerList) { workerList = _workerList; return workerList; } } class DeductionClosedUIBuilder extends SysOperationAutomaticUIBuilder { DeductionClosedContract contract; DialogField dialogWorkerList; HcmWorkerLookup hcmWorkerLookup = HcmWorkerLookup::newOnlyActiveEmployeesWithinCompany(); Set workerListSet; SetIterator it; public void build() { contract = this.dataContractObject() as DeductionClosedContract; dialogWorkerList = this.addDialogField(methodStr(DeductionClosedContract,parmWorkerList),contract); } public void lookupWorkerList(FormStringControl _control) { Query query = hcmWorkerLookup.updateQuery(); smmParametersTable parameters; parameters = smmParametersTable::find(); //Modify the query built by HcmWorkerLookup to filter the employees whos responsibility Id query.dataSourceTable(tableNum(HcmWorker)).addRange(fieldNum(HcmWorker,ResponsibilityId)).value( SysQuery::value(parameters.ResponsibilityId)); workerListSet = hcmWorkerLookup.multiSelectWorkers(); if (dialogWorkerList) { dialogWorkerList.lookupButton(2); } } ////// /// public void getFromDialog() { HcmWorkerRecId workerRecId; super(); List WorkersList = new List(Types::Int64); it = new SetIterator(workerListSet); while (it.more()) { workerRecId = it.value(); WorkersList.addEnd(workerRecId); it.next(); } contract.parmWorkerList(WorkersList); } ////// /// ////// /// public void postRun() { //super(); dialogWorkerList = this.bindInfo().getDialogField(contract, methodStr(DeductionClosedContract, parmWorkerList)); dialogWorkerList.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(DeductionClosedUIBuilder, lookupWorkerList), this); } }
For using query in DP class you can follow this link. In this, report automatically adds everything for you.
community.dynamics.com/.../adding-filter-on-report-in-records-to-include-tab
Hi Brian,
You are using lookup from HcmWorkerLookup class - Calling the multiselectworker method will call another form. So that multiselect is different than what you are looking for. This lookup is used in the Human resource >> Benefits >> Action pane >> Benefits >> Enroll in benefit >. Clicking on add button will open the new form for multi-selection of workers. I think that's the reason why you are not getting values in the DP class.
Please refer to the below blogs in addition with blog suggested by Mohit or creating multi select lookup.
https://d365fotechnicalblog.blogspot.com/2022/06/create-multi-selection-lookup-in-d365fo_5.html
Thanks,
Girish S.
Hi Brian, Please check these articles. If still issue then share your DP class code.
jonesd365.blogspot.com/.../multi-select-lookup-in-ssrs-report-in.html
I added a custAccount parameter in the contract class and it also doesn't get sent to the DP. I suspect something more basic in involved, but the from and to date parameters work fine...puzzling
I am not able to pass the parameter value to the DP class so I'm not sure how using a query would help. I still need the parameter value the user selected.
To make your code simple, you can create a query and use that in your dp class so that you can get the filter criteria button where you can give multiple workers.
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156