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

How to hide the tab pages based on condition

(0) ShareShare
ReportReport
Posted on by 3,851

Hi Folks,

I have added a new tab in vendorProspectiveRegistraion wizard , based on one condition i have make it visible and invisible?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to hide the tab pages based on condition

    I think the skip property just skips the control when user is tabbing through controls.

    Now I looked at this specific form. In the code of the form is methods like "hideAllWizardSteps" and "toTabActions" which should provide some example how to handle this special type of form. The wizard forms are different from other forms so that's why the normal patterns for hiding things don't necessarily apply.

  • veeru ogu Profile Picture
    3,851 on at
    RE: How to hide the tab pages based on condition

    I have done that , even still the problem persist .

    I wan't to know whether skip tab will work to visible or invisible?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to hide the tab pages based on condition

    I would first remove all conditions from the code and just try to make the tab page not visible.

    Also try to debug your code to make sure it gets executed.

  • veeru ogu Profile Picture
    3,851 on at
    RE: How to hide the tab pages based on condition

    i have done in 2 ways

    Approach 1:

    On form oninitalized event i have written the code  like below

      sender.design().controlName(formControlStr(VendProspectiveVendorRegistrationWizard, DocumentsTabPage)).autoDeclaration(true);

      sender.design().controlName(formControlStr(VendProspectiveVendorRegistrationWizard, DocumentsTabPage)).visible(false);

    Approach2:

    i have written one more way on same eventhandler method.

    Both are not working.

               FormRun                                 formRun     = sender.formRun();

               FormBuildTabControl                     formControl = formRun.getTabControl(documentsTab);

               VendRequestProfile                      vendRequestProfile;

               VendProspectiveVendorRegistrationWizard wizard      = formRun.wizard();

               switch (wizard.curTab())

               {

                   case documentsTab :

                   select firstonly vendRequestProfile

                       where vendRequestProfile.IsDefault == NoYes::Yes &&

                             vendRequestProfile.HCLECMAllowSuppliersToAttachDocuments == NoYes::Yes &&

                             vendRequestProfile.ProfileType == VendFieldMetadataGroupType::VendProspectiveVendorRegistration;

                       if (! vendRequestProfile)

                       {

                           wizard.skipTab(documentsTab, true);

                       }

                       else

                       {

                           wizard.skipTab(documentsTab, false);

                       }

                       break;

               }

    Suggest me any other approaches.

  • nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to hide the tab pages based on condition

    Please share your code.

  • veeru ogu Profile Picture
    3,851 on at
    RE: How to hide the tab pages based on condition

    Thanks for the response , i had tried already this solution.

    All Tabpage controls are invisible but tabpag has shown in wizard, but i wan't to hide entire tabpage.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to hide the tab pages based on condition

    Do you mean you added a tab or a tab page? Anyway the solution is the same.

    Just set the AutoDeclaration property Yes for the tab (page), and call myTabPage.visible(true) or myTabPage.visible(false) based on your condition.

    I don't know your condition, but usually these kinds of changes to the form appearance should be made in the init method of the form, after the super() call.

    Many standard forms have a method called updateDesign() which is called from the init method.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#1
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans