- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:32 AM
Hi Developers,
I want to make visible and mandatory ,explanation field once clicked on Reject button when we fill the details state changes to complete and record should be save.
Below is the UI Action &client script
client sacript:Onload()
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setVisible('u_explanation',false);
}
Ui Action :
when i clicked on button field is visible and throwing error message but not changing state as nothing is happened ..
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 09:47 AM
Great! It looks like you marked your own response as the correct answer, which may be confusing to others that read this later.
I felt I covered that above pretty well (first) and included the script which pointed you in right direction on combination of client+server side code
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:40 AM
Hi,
Can you add g_form.setValue('u_quality_state','4'); in client side and check it once.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:41 AM
Hi Santoshi,
Please use g_form.getvalue('u_explaination') instead of u_explaination
It will work
Please mark correct and helpful if it resolves your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:47 AM
Hi,
your UI action is combination of client+server side code
Syntax is incorrect so please update as below
function reject(){
g_form.setVisible('u_explanation', true);
g_form.setMandatory('u_explanation', true);
g_form.addErrorMessage('Your message here');
}
gsftSubmit(null, g_form.getFormElement(), 'reject');
if(typeof window == 'undefined')
statevalue();
function statevalue(){
// your server side code here
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 06:24 AM
Tried but no luck