Additional comments on ritm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 08:01 AM
Hi all,
I want to do these two things when onHold Checkbox is checked on sc_task form:
1) Make Additional comments as visible and mandatory
2) Shows the "Additional Comments" as long as the checkbox "on Hold" is checked, (non mandatory after first change).
So I am defining this Busines rule on SCTask table,
When: before
insert and Update
Condition: onHold is True.
I have created one flag variable to check if the onHold is checked for the first time. which check_on_hold_first_time
This is my code, but except making check on hold first time as true it is not performing any action.
Please help.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 08:13 AM
Hi @pandeyved ,
setMandatory and setVisible methods are from client side and you are trying to use that on server side because of that it won't work.
Better to go with UI Policy or client script in this scenario.
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 08:22 AM
hi @Gunjan Kiratkar
Thanks for your help.
But in my case scenario is different, if checkbox clicked first time then only Additional comments needs to be updated on RITM, not in sc_task. That is why I have created a flag variable also. Please help ne in this context.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 08:44 AM
Hi @pandeyved ,
So your onHold flag is on sc_task and you need to make the ritm comments mandatory then do as follow :
First Approach :-
- Write down onLoad client script on RITM and call script include from there and check the sc task flag if it is true or false and then accordingly make mandatory and visible.
Second Approach :-
- Write down onLoad client script on RITM and fetch flag value from display BR and check the sc task flag if it is true or false and then accordingly make mandatory and visible.
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 09:03 AM
Can you please help me with some code snippet. it on priority.
Thanks