- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 09:31 PM
hi can anyone help me with scenario for :
i want to add a pop up message with a conformation for the field' consider for knowledge' check box field in incident form, when ever it is of for conformation stay the field value checked, when it is cancel remove the check option.
here is my requirment:
"Add a pop-up question "Are you sure?" appear when a user checks the "Consider for Knowledge "box on the Resolution tab of an incident. Have the checkmark stay checked if ok/yes."
code:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 10:03 PM - edited 06-25-2024 10:05 PM
Hi @raj765_32 ,
Please try the below onChange client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('knowledge') == 'true') {
var answer = confirm('Are You Sure?');
if (!answer){
g_form.setValue('knowledge', false);
}
}
}
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 10:03 PM - edited 06-25-2024 10:05 PM
Hi @raj765_32 ,
Please try the below onChange client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('knowledge') == 'true') {
var answer = confirm('Are You Sure?');
if (!answer){
g_form.setValue('knowledge', false);
}
}
}
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 08:25 AM
hi this code is making the box unchecked again when we save the form. after i click on ok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 08:42 AM
Hi @raj765_32 ,
I have tested it in PDI and it is working fine. Have a look at the screenshots:
1. Clicked on the Checkbox, the pop up appeared:
2. Clicked Ok and saved the form:
The client script:
Please check if there are any script running on the same field, you need to deactivate them.
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 10:32 PM