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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Hide single parameter through UI builder class

(0) ShareShare
ReportReport
Posted on by 351

Hi ,

I have requirement to add two new elements in Ledger currency parameter ,"Transaction currency" and "All Currency" , so I have tried to extend the ledgerCurrencySelection Enum and added them. But it is also reflecting in standard Vendor Aging Report also.

So I created a new Enum field for Ledger currency , and I want to use my parameter in my custom vendor aging report and want to hide the standard one. Same way I want to hide my custom field in Vendor aging standard report .

pastedimage1671439649153v1.png

Is there a way to use a parameter or hide it through UI builder class ? Want to use a new parameter or standard one without affecting the standard report parameters.

Please help.

Thanks

I have the same question (0)
  • GirishS Profile Picture
    27,827 Moderator on at

    Hi Priya Dutta,

    If you want to hide the standard parameter - You can directly set the visibility property of the parameter to No in the ssrs report.

    Can you elaborate more on this?

    Thanks,

    Girish S.

  • PriyaDutta Profile Picture
    351 on at

    Hi Girish,

    Thanks for the suggestion.

    Yes I can do that. But the new parameter will still be visible in standard report as I am extending the contract class to create new parameter. I do not want my parameter to affect the standard report.

  • GirishS Profile Picture
    27,827 Moderator on at

    So, you will have 2 menu items to open the report. One will be the standard and other will be customized.

    In that case you want to hide your custom parameters if the report is opened from standard menu item.

    Is that you are asking for?

    Thanks,

    Girish S.

  • PriyaDutta Profile Picture
    351 on at

    Hi Girish.

    Yes thats correct.

    Thanks,

    Priya

  • GirishS Profile Picture
    27,827 Moderator on at

    But there must be two separate designs, right since you have added new parameters to the report?

    One for customized and other will be standard.

    Thanks,

    Girish S.

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    I got your point now. Just write COC for UI builder class for method build. Try the below code.

    [ExtensionOf(classStr(CustAgingReportUIBuilder))]
    public final class CustAgingReportUIBuilder_Extension
    {
        public void build()
        {
            CustAgingReportContract contractclass;
            DialogField dialogEnum;
            contractclass = this.dataContractObject() as CustAgingReportContract;
            dialogEnum = this.addDialogField(methodStr(CustAgingReportContract,YourCustomEnumParameter),contractclass);
            if(this.controller().parmArgs().menuItemName() == menuItemOutputStr(YourCustomMenuItemOutput))
            {
                dialogEnum.visible(true);
            }
            else
            {
                dialogEnum.visible(true);
            }
            next build();
        }
    
    }

    Thanks,

    Girish S.

  • PriyaDutta Profile Picture
    351 on at

    Hi Girish,

    On adding new parameter and then restoring the dataset, why can I see only one parameter on dataset level and 2 on parameter level ?

    pastedimage1671458902116v1.png

    Is this an issue ?

    Thanks.

  • GirishS Profile Picture
    27,827 Moderator on at

    I don't think this will not be the issue unless there wont be any error while deploying or while running report.

    Also, if you duplicate the ssrs report - No need to hide the report parameter - Code which I have sent earlier.

    Standard report will not have the new enum parameter - Only your custom report will have custom enum parameter.

    Thanks,

    Girish S.

  • PriyaDutta Profile Picture
    351 on at

    Hi Girish,

    I am still getting both the parameters in my report.

    Please see the below code.

    class NAVVendAgingReportUIBuilder extends SrsReportDataContractUIBuilder
    {
        VendAgingReportContract VendAgingReportContract;
        public void build()
        {
    
            //CustAgingReportContract contractclass;
            DialogField dialogEnumCustonm,dialogEnumstandard;
            VendAgingReportContract = this.dataContractObject() as VendAgingReportContract;
            dialogEnumstandard = this.addDialogField(methodStr(VendAgingReportContract,parmCurrencySelection),VendAgingReportContract);
            dialogEnumCustonm = this.addDialogField(methodStr(VendAgingReportContract,parmCurrencySelectionNew),VendAgingReportContract);
            if(this.controller().parmArgs().menuItemName() == menuItemOutputStr(NAVVendAgingBalance))
            {
                dialogEnumCustonm.visible(true);
               dialogEnumstandard.visible(false);
            }
            else  if(this.controller().parmArgs().menuItemName() == menuItemOutputStr(VendAgingBalance))
            {
                dialogEnumCustonm.visible(false);
                dialogEnumstandard.visible(true);
            }
            super();
    
        }
    
    }

    I have also added the new UIBuilder class link to contract extension but it is still not getting triggered.

    [ExtensionOf(classStr(VendAgingReportContract))]
    [
        DataContractAttribute,
        SysOperationContractProcessingAttribute(classStr(NAVVendAgingReportUIBuilder), SysOperationDataContractProcessingMode::CreateUIBuilderForRootContractOnly)
    ]
    
    internal final class NAVVendAgingContract_Extension
    {
        public NAVLedgerCurrencySelection navledgerCurrencySelection;
    
        /// 
        /// Gets or Sets the ledgerCurrencySelection parameter.
        /// 
        /// 
        /// The value to set.
        /// 
        /// 
        /// The value of the ledgerCurrencySelection parameter.
        /// 
        [
            DataMemberAttribute('CurrencySelectionCustom'),
            SysOperationLabelAttribute(literalstr("New")),
            SysOperationHelpTextAttribute(literalstr("@AccountsReceivable:CurrencySelectionText")),
            SysOperationDisplayOrderAttribute('5')
        ]
        public NAVLedgerCurrencySelection parmCurrencySelectionNew(NAVLedgerCurrencySelection _navledgerCurrencySelection = NAVledgerCurrencySelection)
        {
            navledgerCurrencySelection = _navledgerCurrencySelection;
            return navledgerCurrencySelection;
        }
    
    }

    pastedimage1671527619737v1.png

    Not sure what is going wrong.

    Please help.

    Thanks,

    Priya

  • GirishS Profile Picture
    27,827 Moderator on at

    You have a separate SSRS report for custom one, right?

    Does the standard report is showing your custom Enum?

    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
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans