Record Producer's Sumbit button is "Submitting..." state and does not revert back to the original st
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 10:03 PM
Use spModal on catalog client script for onsubmit of record producer.
When the submit button is pressed from the record producer, spModal is invoked and a confirm is displayed indicating OK/Cancel.
After the OK button is pressed once here, a validation check is performed by the business rule before, and if there is an error, the control is made to return an error to the record producer (the record is not created).
After the above error is returned to the record producer, if the submit button is pressed again and Cancel is pressed on spModal, the submit button on the record producer will return "Submitting...". on the record producer will remain inactive with "Submitting..." and the button will not become active.
The above problem occurs when the submit button is clicked on the record producer once and then Cancel is clicked on spModal after an error is passed through the server process (business rule).
Do you have any ideas as to the cause?
Is it a glitch in ServiceNow's OOTB?
The script running onSubmit in the catalog client script is as follows A sample is excerpted below.
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 10:24 PM
if the validation passes is the user able to submit the form?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 10:29 PM
@Ankur Bawiskar
Yes, if it passes validation, it can be submitted.
This issue occurs when the Cancel button is pressed on confirm in spModal when the record producer tries to submit again after an error in the server process (business rule).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 10:38 PM
Seems this line is the issue
function onSubmit() {
var actionName = g_form.getActionName(); //submit
spModal.open({
title: "",
message: 'message'
}).then(function(confirmed) {
g_form.submit(actionName);
// return false; // since you are submitting from above line you can comment this line
});
return false;
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader