- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 01:49 AM
Hi,
1 .We have a requirement that in RITM form when state is selected as closed complete , after 1 day it should become Read only.
2. as similar we have request that when state is closed incomplete , closed skipped , then state field should be read only immediately . This one we achieved through UI Policy.
i Need help in Point 1 .
Please help me on this .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 10:11 PM - edited 11-21-2022 10:13 PM
On your RITM form, press CTRL + SHIFT + J and execute below code, and share what's the alert msg you are getting
alert(g_scratchpad.closedDaysAgo)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 11:55 PM
What was the issue with the UI policy I has suggested earlier:-
In the UI policy change the script to below and then try to test it should work:-
function onCondition() {
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
}
}
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 12:29 AM
Remove closed complete option from selection in your OR condition of UI policy, as highlighted in below screen shot
I hope this helps.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 10:11 PM - edited 11-21-2022 10:13 PM
On your RITM form, press CTRL + SHIFT + J and execute below code, and share what's the alert msg you are getting
alert(g_scratchpad.closedDaysAgo)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 10:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 10:36 PM
Hello @nameisnani
I believe your script is not entering the if logic. Can you please try to use the below in the client script:-
g_scratchpad.closedDaysAgo==true intstead of g_scratchpad.closedDaysAgo=='true' i.e without the inverted comma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 11:42 PM
@Saurav11 after making this not working , any other way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 11:55 PM
What was the issue with the UI policy I has suggested earlier:-
In the UI policy change the script to below and then try to test it should work:-
function onCondition() {
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
}
}
Please mark my answer as correct based on Impact.