- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 07:33 AM
Hi,
There is a field "App Code" in one of the catalog items which has a validation to check if the user is entering already existing app code, in case he is entering the existing one it should alert "Requested app code already exists choose a different one".
I am using the below script:
var ui_app_code = g_form.getValue('u_requested_app_code');
var gr = new GlideRecord('cmdb_ci_appl');
gr.addQuery('u_application_code', ui_app_code);
gr.query();
while(gr.next())
{
alert (" Requested App code already exists. Please choose a different one...");
return false;
}
}
If I am trying to submit the catalog item using the existing app code from an ESS page I have an alert and the form does not get submitted but the same is not working in service portal. can some one help me on what modifications has to be done to the code to make it work in service portal.
Thanks,
Bargavi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2016 10:01 AM
was able to resolve it using thread Catalog Client Script asyncrhonous query to stop submission onSubmit.
Thanks for replying
-Bargavi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 07:40 AM
On the catalog client script make sure you have the UI Type field set to mobile or both and not desktop.
documentation/client_scripting.md at master · service-portal/documentation · GitHub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 08:01 AM
Hi Brad,
I already have the UI type for Both selected in Catalog Client Script.
Thanks,
Bargavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 08:11 AM
Hi,
Please check your browser javascript console for errors.. that can give some clue..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 12:41 PM
Hi Parameswar,
There are no errors in console .
Thanks,
Bargavi