- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 09:50 AM
Thank you for your help in advance!
Problem:
When a state is updated to "closed complete" or "closed incomplete" by the agent without saving it greys out (changes to read only). Agent has to refresh the entire page if he/she accidentally selects one of the options above, which is a big inconvenience when there's work notes and customer notes added.
What I want:
When an agent select "closed compete" or "closed incomplete" it shouldn't be read only. They should be able to change as they like. But once the agent SAVE or UPDATE the task with state "closed complete" or closed incomplete" state should change to read-only. Our policy is once a task is marked complete/incomplete we don't want it to be updated.
Screenshots below for reference. Again, thank you!
Current UI Policy Setup:
When closed without saving it is changing to read-only:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 11:48 PM
I suggested to write an onLoad but the screenshot shows onSubmit.
And also state == '3' || state =='4'
3 and 4 should be in quotes.
Make those changes and try now.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 10:11 AM
You can make that ui policy inactive and write an onLoad client script as below :
if(g_form.getValue('state') == '3')
{
g_form.setReadOnly('state',true);
}
Mark as correct or helpful if it worked.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 10:15 AM
Thank you Sumanth! Just for clarification, will there be any impact using client script over UI policy?
Even though I said we don't want agents to make updates to state after it saved in closed, some exceptions are made by admins and the states are updated once in a while through report view for example. Will that be impacted?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 10:20 AM
Hi Sam, I don't think it will impact however if you have to change functionality after saving the form you can use onSubmit client script as below, ( i would suggest just deactive UI policy and try this script to check impact if you are working on dev instance)
function onSubmit() {
var state = g_form.getValue('state');
if (state == 3 || state == 4) {
g_form.setReadOnly('state', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 08:49 PM