- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 09:35 PM
Hi can anyone help me with how to pop up the message above the field when the field is updated,
A message pops up right above the "Follow up Date" field in a PTASK when the "Follow up Date" is updated
Message: "Please contact Problem Management to modify the due date"
Solved! Go to Solution.
- Labels:
-
Problem Management
-
Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 10:29 PM
@sai charan7 Just add one more line in if block as below
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue === '') {
g_form.showFieldMsg("follow_up", "Please contact Problem Management to modify the due date", "error");
g_form.setValue("follow_up", oldValue);
}
}
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 09:57 PM
You can try using the field message
Syntax:- g_form.showFieldMsg('impact','Low impact not allowed with High priority','error');
docs link : https://docs.servicenow.com/en-US/bundle/tokyo-application-development/page/script/useful-scripts/re...
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 10:01 PM
i have written on change client script but its not working,
i have to display a pop up only when follow up date is getting chnaged.
here is the code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
//if (isLoading || newValue === '') {
// return;
//}
var ab=g_form.getValue('follow_up');
if(ab==''){
g_form.showFieldMsg("follow_up","Please contact Problem Management to modify the due date","error");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 10:18 PM - edited 12-08-2022 10:19 PM
Simply try this one to show message on the follow up field.
Note: I've not checked for the new record condition if required you can add it
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.showFieldMsg("follow_up","Please contact Problem Management to modify the due date","error");
}
Adding result screenshot for reference,
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 10:23 PM
hi thanks,
iam getting alert but he is able to change to new value which i dont want to change it