web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set Email form to readonly

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I have added custom status code values to the Email entity. On setting of these custom status code, the form becomes editable. On these statuses i want the form to freeze. I tried setting the fields to readonly but CRM throws error if any of the field does not have value. Can anyone of you help me achieve the requirement. Any pointers would be appreciated.

Kind regards,

Thank you

Mehaboob

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Mehabob,

    What is the  error you are getting when you are setting fields readonly ? How you are making control disabled ? Please share your code here ?

    Seems you are missing something. I would suggest create a JS function and  register onload event . Based on form type and the custom status code disabled all control in the email form.

  • Community Member Profile Picture
    on at

    Hi Goutam,

    Thank you for reverting. I am no more able to get that issue post using the below code

    function disableAllFields() {

           Xrm.Page.ui.controls.forEach(function (control, i) {

               if (control && control.getDisabled && !control.getDisabled()) {

                   control.setDisabled(true);

               }

           });

       }

    Regards

    Mehaboob

  • Suggested answer
    Community Member Profile Picture
    on at

    no more getting the issue post using below code

    function disableAllFields() {

           Xrm.Page.ui.controls.forEach(function (control, i) {

               if (control && control.getDisabled && !control.getDisabled()) {

                   control.setDisabled(true);

               }

           });

       }

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans