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)

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

I have the same question (0)
  • dpkr28 Profile Picture
    135 on at

    hi Alvin,

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

     

    Thanks

  • Suggested answer
    Community Member Profile Picture
    on at

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

  • Suggested answer
    Community Member Profile Picture
    on at

    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.

  • Community Member Profile Picture
    on at

    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.

  • dpkr28 Profile Picture
    135 on at

    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

    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.

  • Community Member Profile Picture
    on at

    Hi guys,

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

    Thank you.

  • dpkr28 Profile Picture
    135 on at

    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

    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.

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