I am trying to make a reference field mandatory and read-only at same time.

Taaha M
Tera Contributor

When I am trying to make a field  (type- reference) mandatory and read-only, I am not able to do it. It is only possible if I change the mandatory action to leave alone.

Never I have seen this behaviour, why is it not working.

The below screenshots shows how the field is read-only when mandatory is 'leave alone'.

TaahaM_0-1732770904183.png 

TaahaM_0-1732770963607.png

The below screenshots for mandatory changed to true in UI policy action.

TaahaM_1-1732771050939.pngTaahaM_2-1732771120077.png

 

 

 

 

1 ACCEPTED SOLUTION

Making a field mandatory means the user must select or enter a value before submitting the form. However, if the value is automatically populated based on another field, making the field read-only is sufficient. In this case, marking the field as mandatory doesn't make sense, as the value is pre-filled and cannot be changed by the user. Setting it to read-only ensures the value remains fixed and cannot be modified.

 

 

 

 

"If this response was useful, please select 'Accept as Solution' and mark it as 'Helpful.' This helps me provide better answers and assists the community ".

Regards,
Pradeep

View solution in original post

7 REPLIES 7

Runjay Patel
Giga Sage

Hi @Taaha M ,

 

You can not make mandatory field read only if value is empty.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

it is getting auto-populated based on responses on another field.

Pradeep Thipani
Mega Sage

Hi @Taaha M ,

 

May I know what is the business use case here? because how the user will save/submit the form when a field is mandatory and read-only at same time.

 

Thanks,

Pradeep

"If this response was useful, please select 'Accept as Solution' and mark it as 'Helpful.' This helps me provide better answers and assists the community ".

Regards,
Pradeep

I am autopopulating a field based on response on another field.