The CreatorCon Call for Content is officially open! Get started here.

Is it possible to make a field mandatory and read only in the form ? If yes what is the use ?

Karunakar3
Kilo Contributor

Is it possible to make a field mandatory and read only in the form ? If yes what is the use ?

1 ACCEPTED SOLUTION

Josh Virelli
Tera Guru

Hi Karunakar,

You can of course set a field to both Read-Only and Mandatory, however the Read-Only part will "win-out" against it. Meaning, even if there isn't a value in the field, you could still save the record. Just like Mandatory will win out over Visible.

I would rarely recommend using the checkboxes on the Dictionary Entry to set Read-Only and Mandatory, instead I'd recommend using a UI Policy.

I think there are very few use cases for making something Read-Only and Mandatory. One I can think of is if you want to ensure a field is always Mandatory, and there are cases that would change whether or not it is Read Only, but even then, I would think you could have the Mandatory set to true/false with the opposite of the same condition as the Read Only being set to true/false.

Is there a specific use-case you had in mind, or did you just want some thoughts on this? Let me know if I can assist further. 

If my answer was helpful or answered your question, please mark it as 'Helpful' or 'Correct'

Thanks!

Josh

View solution in original post

10 REPLIES 10

Hitoshi Ozawa
Giga Sage
Giga Sage

A case when Mandatory and Read-only is used is when requiring valid email address of a logged in user.

A password reset form may have a field to enter logged in user in a user field and only fetch logged in user's email address. However, a new user or a part time user may not yet be assigned an email address. In this situation, since there's no valid email to send an email to reset the password, submission should fail and tell the user to wait.