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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Multiselect Enum values on SSRS report using UIBuilder

(0) ShareShare
ReportReport
Posted on by 657

Hi,

I'm trying to add a multiselect parameter based on a Enum field for an SSRS report using a UIBuilder.

I already glanced through the following article but to no avail : https://community.dynamics.com/ax/f/33/t/156101

I'm trying to use the SysLookupMultiSelectCtrl combined with an InMemory temp table.

So in my UiBuilder class I have following code

fillTmpEnumTable (fill in memory tmp table)

SPLShipmentListStatusTmp enumTmp;
SysDictEnum dictEnum = new SysDictEnum(enumNum(ProjStatus));
int idx;

delete_from enumTmp;

for (idx = 0;idx < dictEnum.values();idx++)
{
enumTmp.clear();
enumTmp.initValue();
enumTmp.EnumId = dictEnum.index2Value(idx);
enumTmp.enumLabel = dictEnum.index2Label(idx);
enumTmp.insert();
}

statusListTmp.setTmpData(enumTmp);

postBuild

this.fillTmpEnumTable();

dfProjStatus = this.bindInfo().getDialogField(contract,methodStr(SPLShipmentListContract,parmProjectStatus));

ProjStatusQueryRun

QueryRun    queryRun;

queryRun = new QueryRun(queryStr(SPLShipmentListStatusTmp));
queryRun.setCursor(statusListTmp);

return queryRun;

postRun 

msProjState = SysLookupMultiSelectCtrl::constructWithQueryRun(this.dialog().dialogForm().formRun(),
dfProjStatus.control()
,this.ProjStatusQueryRun());

I tried several alternations and changes but the lookup remains empty.

Any Suggestions?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Though the topic is not exactly for base enums, here is a generic topic on using UI builder with a multi-select lookup:

    community.dynamics.com/.../238758

    Notice the difference, which is using SysLookupMultiSelectGrid, where you may try to bind your datasource.

  • Sven Peeters Prodware Profile Picture
    657 on at

    Hi Vilmos,

    I tried that approach too but won't work with In Memory tables either.

    I added the override in the postBuild

    dfProjStatus.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(SPLShipmentListUIBuilder, ProjStatusLookup), this);

       if (dfProjStatus){

           dfProjStatus.lookupButton(2);

       }

    And used this code for populating the lookup

    private void ProjStatusLookup(FormStringControl _control)

    {

       msProjState = SysLookupMultiSelectGrid::construct(_control, _control);

       msProjState.parmQuery(this.ProjStatusQueryRun().query());

       msProjState.parmQueryRun(this.ProjStatusQueryRun());

       msProjState.run();

    }

    But same result, it stays empty. Bizar that you need to specify parmQuery and parmQueryRun. If you only specify parmQueryRun, then you get an error because the query is null. Pretty sure it isn't using the QueryRun anywhere so it will never get the data in my tmp table :-(

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans