How to set RITM fields readonly through Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 08:32 AM
Hi All,
I have below scenario and need help for this,
i am creating a change and ctask through service catalog request.
so brought a field called parent (Requested item backend name :parent.parent) on Ctask form and i need to make its variables readonly after ctask closed (for testing taken target_ci variable only). so thinking to do it through business rule but it is not working, Please help me to solve this.
Conditon : After update , status is closed
Script:
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.parent.parent);
gr.query();
if(gr.next()){
gr.setReadOnly('gr.variables.target_ci',true);
gr.update();
}
})(current, previous);
Thanks & Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 09:05 AM
Hi,
You cannot make fields Read only using business rule. Business rule work on Server side and you can only perform server side (backend) operations using business rule.
To make field read only you can use client script and UI policies.
Thanks,
Anil Lande
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 09:16 AM - edited 10-03-2022 09:17 AM
Create catalog client script or UI policies. Make sure it will be execute only on Catalog task by checking checkbox as shown below link:
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 02:39 AM
Hi Anil,
Thank you for your reply, could you help to build below scenario.
I have requirement to set ritm variables read only after closing ctask so how I can achieve this.
Regards,
Datta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 09:19 AM
Hello @Datta Pisal1
You cannot make the fields readonly using the Business rule.
1. You can make the fields read only at server side using the ACL or Data policy
2. You can make the field read only at client side using UI Policy or Client script.
Please share your exact requirement when do you want to make the field read only.