SC Catalog Item widget submission question
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 11:24 AM
Our team cloned the ootb SC Catalog Item widget and is wondering how this widget actually submits the record producer. We see the client script for triggerOnSubmit, but don't see how this onClick function actually submits the record producer.
$scope.triggerOnSubmit = function(timeout) {
if ($scope.options.isServiceWorkspace && $window.frameElement) {
var workspaceParams = {};
workspaceParams.sysparm_parent_table = $window.frameElement.getAttribute('parent-table');
workspaceParams.sysparm_parent_sys_id = $window.frameElement.getAttribute('parent-sys-id');
$scope.data.workspaceParams = workspaceParams;
}
$scope.data.sc_cat_item.item_action = "order";
$scope.data.sc_cat_item.quantity = c.quantity;
$scope.$evalAsync(function () {
if (g_form) {
$scope.submitting = true;
if (!spScUtil.isRegexDone($scope.data.sc_cat_item._fields)) {
$scope.submitting = false;
$scope.validating = true;
} else if (!g_form.submit()) {
timeout = timeout || 1000;
$timeout(function () {
$scope.$broadcast('$sp.service_catalog.form_submit_failed', {action_name: 'submit'});
}, timeout);
}
}
})
return false;
}
Can anyone provide some direction on where the actual submission is being called?
Labels:
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 09:45 AM
actually the submission is happening inside the IF statement:
if (!g_form.submit()) {
the ! (not) executes the following code if g_form.submit() had an error....
(kinda sneaky)