- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2023 12:40 AM
Hi,
i made a client script that checks from case choise "is incident" and if value is 'Incident' the script creates automatically incident by calling the create incident ui action. How ever, i was requested to change this from onChange to onSubmit and im stuck 🙂
here is the code, can someone help me to adjust this to onSubmit. Now the code is trying to submit and asks if you want to leave the page and all unsaved work will be lost and no matter what you choose the sn_customerservice_case parent does not create the incident.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var incValue = g_form.getValue('u_incident');
if (incValue == 'Incident') {
gsftSubmit(null, g_form.getFormElement(), '48c8ae1a877313003c1c8467a7cb0b00');
} else {
return;
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2023 02:22 AM
Rather than calling the UI action I'd just copy the content of the UI action's script into the BR.
Sure, if there are changes in the logic, you'd have to update it in two places, but it should still be manageable.
Only thing to note is that if the Ui action is client callable then it won't be possible to directly copy the script, but if it's just server side stuff then there's no problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2023 03:19 AM
thanks! ill give this a try