On Submit client script runs multiple times on Service Portal for request item when used on a OOB form widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2020 02:56 AM
Hi All
I am having issues with implementing a solution that allows a user to update a request item from the Service Portal using a page with a copy of the form widget.
I first thought it was my environment or changes to the form widget that I made, but my developer instance behaves the same. To replicate is very simple. I created an on submit client script of a catalog item and checked the box so it applies on requested items . (I also tried one on the sc_req_item table. Both caused the same issue.)
To replicate,
1) The client script is something simple like:
function onSubmit() {
//Type appropriate comment here, and begin script below
var value = g_form.getValue('fieldname');
alert(value );
}
2) Then create a blank new Service Portal page with an id and add the OOB form widget.
3) Launch the Service Portal page with a open request item id (note if using catalog item client script then item must be of same type)
e.g.
4) Make a change and save the form.
The alert pop-up appears more than once. (in fact sometimes multiple times)
Would this be a bug or do onSubmit client scripts not allow this?
Thanks for whomever takes the time. BTW I running on Madrid.
Regards
Shane
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2020 06:03 AM
can you modify it something like this?
function onSubmit() {
//Type appropriate comment here, and begin script below
var value = g_form.getValue('fieldname');
alert(value );
return true;
}
Thanks
Harshad