- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 04:07 PM
I am developing a catalog and need to have one of the variables remain editable after the approvals are received. It only needs to be editable until the first task is completed. Right now, I am just trying to override setting the read only property after setting all the other variables to read only. The way I have it below is not functioning correctly. Any assistance would be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 05:23 PM
Out of curiosity, if you edit the code to look like below, does it execute the way you'd like it to?
function onLoad() {
var stage = g_form.getValue('sc_req_item.stage');
if(stage == 'request_approved' || stage == 'completed'){
setTimeout(function () {
g_form.setVariablesReadOnly(true);
g_form.setReadOnly('legal_hold', false); //Revert legal hold to editable
g_form.setDisplay('legal_hold',true);
}, 500);
}
}
If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 04:30 PM
What is the current behavior of the script when executed in the instance? Can you share a screenshot of the form before and after? My initial guess is that there is some other rule executing that we're unaware of, but seeing the form will help dig further.
If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 04:57 PM
If the stage is not request_approved or completed, the form will set all of the variables on the SCTask to read only. I have tried to create another client catalog script that will set the read only property of the legal_hold field to false if the task short description is "Verify if employee is on legal hold", but that hasn't worked either.
Can you order the client scripts? That field isn't exposed, but I can see it available. I haven't tried setting that for the scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 05:23 PM
Out of curiosity, if you edit the code to look like below, does it execute the way you'd like it to?
function onLoad() {
var stage = g_form.getValue('sc_req_item.stage');
if(stage == 'request_approved' || stage == 'completed'){
setTimeout(function () {
g_form.setVariablesReadOnly(true);
g_form.setReadOnly('legal_hold', false); //Revert legal hold to editable
g_form.setDisplay('legal_hold',true);
}, 500);
}
}
If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 07:44 PM
Well, that works on the RITM. Once the RITM stage is Request Approved, it shows the legal_hold field, and it is editable. But the legal_hold field doesn't show on the SCTask. That was where I was hoping to have the user interact with the field, but I may have to leave it like this and direct them to update the RITM.
I have checked UI Policies, Business Rules, Client Scripts and can't figure out how to override the read only properties in the SCTask. I thought I had found a UI Policy causing the conflict, but I disabled it and still have the issue.