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 CRM (Archived)

Mass conditional lock / unlock fields;tabs;section

(0) ShareShare
ReportReport
Posted on by 27

Dear All, 

Can anyone help me to lock/unlock tabs or section?

I want to enable conditional fields editable.

Is there any script or configuration? 

I am seeking your urgent support.

Thanks,

Hema 

*This post is locked for comments

I have the same question (0)
  • necsa Profile Picture
    3,455 on at

    Hi,

    You can have following links as reference:

    community.dynamics.com/.../crm2011-disable-enable-fields-sections-tabs-and-the-whole-form

  • Hema Mesta Profile Picture
    27 on at

    Thanks for your  reply. Is it applicable for CRM 365 as well?

  • necsa Profile Picture
    3,455 on at

    If you have difficulty to match to Dynamics 365 here is another reference for the Dynamics 365:

    carldesouza.com/.../

  • Hema Mesta Profile Picture
    27 on at

    Thanks, Necdet. I am new to CRM technical part. Could you please assist me on how to add this code. I added it but it's throwing me an error.  

    Error message: Web resource method does not exist: Ticker Change

    What function name I should mention while adding?

    Thank you once again for your support.

    Hema

  • Suggested answer
    necsa Profile Picture
    3,455 on at

    Hi Hema,

    Can you give me more detail under which condition you want to lock/unlock tabs or section.

    What is the name of tab/section you want to lock/unlock and under which condition it must work?

  • Suggested answer
    Hema Mesta Profile Picture
    27 on at

    Hi,

    On page load and tab click event I want to disable. I have added below code in web resources as Script JS.

    function CIFApprovedChange() {

    if(Xrm.Page.getAttribute('new_cafid').getValue() == null) {

    alert ("testing");      

    Xrm.Page.ui.tabs.get('Screening').setVisible(false);

      }

      else {

          Xrm.Page.ui.tabs.get('Screening').setVisible(true);

    alert ("testing1");

      }

    }

    This library I added to form property with on load event of the form plus on change event of the tab.

    However, I am getting the following error.

    Web resource method does not exist: CIFApprovedChange()

    I don't know where I am making mistake.

    Thanks for your support.

    Hema

  • Suggested answer
    necsa Profile Picture
    3,455 on at

    Hi Hema,

    Is the field ("new_cafid") on the Tab or out of Tab on the Form. If the field on the Tab that is not good way to set the Tab unvisible because you never change the value. This field must be out of the Tab which you want to set depends of condition "setVisible()". Also you cannot use "TabStateChange" event for this reason. This event occurs when a tab is expanded or collapsed. Instead of Tab use your code on the Field OnChange event. Here in your case onChange event of "new_cafid".

    I tested your code and it is working. I name the webresource as nec_lockTab (you can use any name doesn't important. Function name is same as your  ( CIFApprovedChange)

    instead of your field name ('new_cafid') I use existed field ('websiteurl') the Display name is 'Website' You can match as you wish to your environment. Upload your code to webresource.

    Here some screenshot step by step

    Open customization entity form and select Form properties.

    property.png

    add your code to form properties from webresources and select Control : Form   Event: Onload and click on the Add button.

    form-property.png

    on the Handler Properties select Library: "your code name" Function: add your function name and finaly check Enabled.

    7026.Handler-Properties.png

    again return to Form Properties and select Control: "your field display name"  Event: OnChange and click on the Add button

    field-onchange.png

    on the Handler Properties select Library: "your code name" Function: add your function name and finaly check Enabled.

    field-handler.png

    click Ok and also OK on the Form Properties and on the Entity Form select Save and then click on "Publish"

    3007.publish.png

    return to your entity and tested it must work smootly.

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans