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

Making fields inactive

(0) ShareShare
ReportReport
Posted on by 40

Hello community,

we have the following process: If some guy create an order in CRM he needs to start the worklow. Then some other needs to approve or decline this order. Once approved a mail is sent with this information.

I want now to add now a step that after the approval the order form fields cannot be changed any longer. Can somebody please explain to me with which step i can achieve this?

Thanks

*This post is locked for comments

I have the same question (0)
  • SteffenH Profile Picture
    40 on at
    RE: Making fields inactive

    Thanks a lot for this answer.

    unfortunately i have no idea how and where to use the JS code. So can you please describe a bit more detailed how to process with your option number 2?

    In the approval process (which is defined as dialog field) is a step: "if approval has been given yes, then". After this clause i need to add something i guess. But which step in detail?

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    2,545 on at
    RE: Making fields inactive
    Hi,
    There are 3 ways to achieve this:
    1. Javascript to disable all fields
    2. Add Step within the same workflow to deactivate the record
    3. Write Business rule (but business rule have some limitation refer URL: community.dynamics.com/.../business-rules-and-read-only-forms)
     
    However, the best options are 1 and 2.
    Code for option 1:
    add script on load of form
     

    function disableFormFields()
    {
        //check if the record field value is set to approved if yes then add below code
        
           Xrm.Page.ui.controls.forEach(function (control, index) {
               var controlType = control.getControlType();
               if (controlType != “iframe” && controlType != “webresource” && controlType != “subgrid”)
               {
                   control.setDisabled(true);
               }
           });
    }
  • SteffenH Profile Picture
    40 on at
    RE: Making fields inactive

    Thanks Jarrod,

    what do you mean with "You could also set up a rule that based on the state or status field certain fields are marked as read only in progression. "?

    Do you mean a business process?

  • Suggested answer
    Jarrod Williams Profile Picture
    1,747 on at
    RE: Making fields inactive

    Assuming that the fields don't map into groups yes.  You could use a single rule or piece of JS code to set fields to read-only based on the value of another field.  For example you could have one field that says state and that could control 2 fields and another that says state 2 that controls a different field.  You could also set up a rule that based on the state or status field certain fields are marked as read only in progression. 

  • SteffenH Profile Picture
    40 on at
    RE: Making fields inactive

    Okay, but this would mean i need to add one Component (activate/deactivate) for each field i want to make read-only right?

  • Ahtesham Profile Picture
    111 on at
    RE: Making fields inactive

    You Can Simply write Business Rule to make field read only on update of order status.

  • Suggested answer
    Saad Kabarousse Profile Picture
    734 on at
    RE: Making fields inactive

    Hello,

    If you want to disable the whole form fields once it is approved, you can add a workflow step, a workflow that changes the statecode of the quote to actif. i think this may help you.

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans