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)

Enable/Disable report parameters based on another parameter of SSRS report

(0) ShareShare
ReportReport
Posted on by

Dear All,

I developed a new report in which there are multiple parameters. I want to Enable/Disable some parameters based on select/unselect of another parameters.

for example: in the below snap, if Aging is selected, then Aging Period 1 to Aging Period 5 will be enabled else these parameters will be disabled.8546.Dialog_5F00_Aging.png

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    This kind of things is done in UI builder classes. You create a UI builder class, associate it with your contract class (using SysOperationContractProcessingAttribute) and register a method override for the change of the Aging control. There you set enabled() of other controls.

    It's a really brief description, but it should allow you to find details on internet. Come back here if you get stuck somewhere.

  • Community Member Profile Picture
    on at

    Thank you Martin for the quick reply!!

    Actually I wrote the code in postBuild() method of UIBuilder calss. It only worked for only one parameter, but I have to make it work for five param.

    super();

       //

        // get datacontract

       contract = this.dataContractObject();

       // get dialog fields

       dialogAging       = this.bindInfo().getDialogField(contract, methodstr(DetailDueDateContract, parmAgingOnDueDate));

       // register override methods

        dialogAging.registerOverrideMethod(methodstr(FormCheckBoxControl, modified), methodstr(DetailDueDateUIBuilder, allowModifyAge1), this);

       // enable/disable periods

       dialogAge1.enabled(any2enum(dialogAging.value()));

    when I write the code to disable more than one parameter by calling registerOverrideMethod multiple times, like

        dialogAging.registerOverrideMethod(methodstr(FormCheckBoxControl, modified), methodstr(DetailDueDateUIBuilder, allowModifyAge1), this);

        dialogAging.registerOverrideMethod(methodstr(FormCheckBoxControl, modified), methodstr(DetailDueDateUIBuilder, allowModifyAge2), this);

    after compiling, when I rerun the report, I got the Error "RegisterOverrideMethod was called twice for the same object for method 'modified'. You can only override a method once per instance."

    How to get it done??

  • Verified answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    That's not how it works. You don't want to execute five different methods instead of the standard one, you want to execute a single method and put all your logic there (such as enabling/disabling five controls) there.

  • Community Member Profile Picture
    on at

    Thank You Sir...I got the solution

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Then please don't forget to close this thread by marking the answer(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 > 🔒一 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