Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Read-only Mandatory Fields Got Caught In Required Fields Validation

(0) ShareShare
ReportReport
Posted on by

Hello guys,

I've got a confusing problem here. There's this form with a mandatory field that has been set as Read-only field (greyed out). This field's got caught in the 'required' validation when I clicked the Save button, stating "You must provide a value for Total Acquisition Tax Amount". This shouldn't happen and I have tried making a fresh form with a new Mandatory field set to read-only, which didn't get caught in the validation.

As an additional note, I consider trying to remove and add the field again but I hope that I can avoid this and able to find another solution.

Any hint is appreciated.

Thank you.

EDIT#1: 

I've got a new discovery about this bug. Since this form is in a business process flow, there are several steps where this form is the first step. If I fill out all the required field except the Total Acquisition Tax Amount which is read-only then click the save button, I'll get the "You must provide a value for Total Acquisition Tax Amount" message. However, when I go to the next step and go back to this form, the save button works just fine. And this actually confuses me more.

EDIT #2:

So the cause was because the read-only required field is included as a step in the BPF, but on the second stage. Somehow that prevents the read-only field to pass the CRM's Save button validation. I tried to create a fresh entity and successfully reproduced the "bug" without any javascript or plugin, so I can say it's from CRM side. The solution is either move the step to thefirst stage and make it read only through javascript, or change the field from Business Required to Business Recommended or Optional. After discussion with my team, it was decided to just remove the mandatory.

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    I've discovered the cause long time ago but I forgot to update this.

    So the cause was because the read-only required field is included as a step in the BPF, but on the second stage. Somehow that prevents the read-only field to pass the CRM's Save button validation. I tried to create a fresh entity and successfully reproduced the "bug" without any javascript or plugin, so I can say it's from CRM side. The solution is either move the step to the first stage and make it read only through javascript, or change the field from Business Required to Business Recommended or Optional. After discussion with my team, it was decided to just remove the mandatory.

    Thank you everyone for the responses. I appreciate it.

  • dpkr28 Profile Picture
    135 on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    Alvin,

    there is some business process logic on save / onchange in java script  to set business process stage please check with business analyst and get full Idea.

    As per my knowledge , your setting Business process stage based up on business logic in java script &  

    Total Acquisition Tax Amount is mandatory in business process flow first stage .

    So while key-in all the data and if  you click on save then java script will execute and trying to set next stage in business process stage.

    i.e your getting error message

    "You must provide a value for Total Acquisition Tax Amount " because the value is null and the business process stage is in First stage.

    Please share your java script to identify the root cause.

    Thanks,

    Pavan

  • Community Member Profile Picture
    on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    Hi guys,

    I've got a new discovery. I've added the details in my question, marked EDIT#1.

    Thank you.

  • Community Member Profile Picture
    on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    Hi Pavan,

    I've looked for the schema name "xjp_totalacquisitiontaxamount" and I got 0 results from the entire javascript(s). The business required setting comes from the field customization. It should be intended since the form's design document states so and I also have confirmed this with the business analyst.

  • dpkr28 Profile Picture
    135 on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    Alvin,

    Identify the "Total Acquisition Tax Amount" schema name and Check entire javascript function in which areas they used Total Acquisition Tax Amount field making as business required.

    or

    Provide your java script  

    Thanks,

    Pavan

  • Community Member Profile Picture
    on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    Hi all thank you very much for the responses.

    I have checked the js beforehand and it does have lines of script for OnSave event. However, it doesn't fire when I click the save button so I assume the problem is not on the OnSave event. I also tried to edit the OnLoad event through browser debugger and emptying the whole OnLoad function, thinking that there might be script that somehow changed the properties. Alas, the problem still exists.

    As for the business rule, the form doesn't have any business rules.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    Hi Alvin,

    You can also check is there any business rule attached with that field?

    Check it only If your working environment is CRM2013 or above.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    Please check if there is any code attached to that field on save event of that form.

  • dpkr28 Profile Picture
    135 on at
    RE: Read-only Mandatory Fields Got Caught In Required Fields Validation

    hi Alvin,

    Please check js function on save of the form. their must be some business logic written on save from.

     

    Thanks

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,923 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,788 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans