Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

hide forms tab in a form head crm dynamics 365

Posted on by Microsoft Employee

Hello folks,listformsHide.PNG

I have an entity which contains 2 forms, I want to prevent navagation between these 2 forms based on the value of two option field. In other words if the value of need prescoring is yes navigation is not possible and the inverse, how can I do this ?

Is it possible to simply hide the list ?

Thanks,

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: hide forms tab in a form head crm dynamics 365

    As it's not supported I used another solution which is to check if the boolean is true and the name of the, if the user tries to change the form he will be redirected to the right form until he changes the value of the boolean.

    DiligenceSwitch: function(){

       if (Xrm.Page.ui.formSelector.getCurrentItem() != null) {

           var currentform = Xrm.Page.ui.formSelector.getCurrentItem();            

       }

       if (currentform != null) {

           var formId = currentform.getId();

           var formLabel = currentform.getLabel();

       }

       var kycId = Xrm.Page.data.entity.getId();        

       SDK.REST.retrieveRecord(kycId, "kyc_Kycdiligence", "kyc_Needprescoring", null,               //field for searching the targeted field, entity, targeted field, ...

           function (kyc) {

               if (kyc != null || kyc.kyc_Needprescoring != null) {

                   if (formLabel != "Pre-Scoring" && kyc.kyc_Needprescoring == true) {    

                       var windowOptions = { openInNewWindow: false };

                       var parameters = {};

                       parameters["formid"] = "4B0C88A9-720C-4BFA-8F59-7C1D5DD84F02";

                       Xrm.Utility.openEntityForm("kyc_kycdiligence", kycId, parameters, windowOptions);

                       alert("Vous devez faire le pre-scoring");    

                   }

               }  

           },

           function (error) {

               Xrm.Utility.alertDialog(error.message);

           });

    },

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: hide forms tab in a form head crm dynamics 365

    From you screenshot and explanation, what you are trying to do should be achieved via a single form, with just hiding and showing tabs based on user selection. The form selector can only be partially controlled, but what you want to do is unsupported.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: hide forms tab in a form head crm dynamics 365

    Hello,

    The only way you can limit the number of available forms is to assign form availability based on security role available for user.

    Other workaround is onload JS but it will look clunky. Check this thread - community.dynamics.com/.../223710

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans