- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 12:23 AM
I have a issue with my client script. It is working as expected in native UI but not in workspace.
UI Type is "ALL" & Isolate script is checked to "True"
Client Script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 02:33 AM
hi @Sanchita02 ,
can you try below code
function onSubmit() {
//Type appropriate comment here, and begin script below
var currentAttribute = (g_form.getValue('u_type_of_attribute'));
var currentApplication = (g_form.getValue('u_application'));
var curremtMF = (g_form.getValue('u_member_firm'));
var currentTitle = (g_form.getValue('u_title'));
var checAttributes = new GlideAjax("x_kpm94_ce.GQRM_Client_Evaluation_ClientUtils");
checAttributes.addParam('sysparm_name', 'checkduplicateAttribute');
checAttributes.addParam('sysparm_attribute', currentAttribute);
checAttributes.addParam('sysparm_application', currentApplication);
checAttributes.addParam('sysparm_memberfirm', curremtMF);
checAttributes.addParam('sysparm_title', currentTitle);
checAttributes.getXML(function(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'true') {
return false;
} else {
g_form.setValue('submit_flag', true); // Indicate that the form can be submitted
// Optionally submit the form or allow the default behavior
} });
}
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 01:00 AM
hi @Sanchita02 ,
Unfortunately it won't work in workspace.Please note that the use of getXMLWait() is no longer supported.
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 01:28 AM
@Bhavya11 Is there any other option for getXMLWait()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 02:33 AM
hi @Sanchita02 ,
can you try below code
function onSubmit() {
//Type appropriate comment here, and begin script below
var currentAttribute = (g_form.getValue('u_type_of_attribute'));
var currentApplication = (g_form.getValue('u_application'));
var curremtMF = (g_form.getValue('u_member_firm'));
var currentTitle = (g_form.getValue('u_title'));
var checAttributes = new GlideAjax("x_kpm94_ce.GQRM_Client_Evaluation_ClientUtils");
checAttributes.addParam('sysparm_name', 'checkduplicateAttribute');
checAttributes.addParam('sysparm_attribute', currentAttribute);
checAttributes.addParam('sysparm_application', currentApplication);
checAttributes.addParam('sysparm_memberfirm', curremtMF);
checAttributes.addParam('sysparm_title', currentTitle);
checAttributes.getXML(function(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'true') {
return false;
} else {
g_form.setValue('submit_flag', true); // Indicate that the form can be submitted
// Optionally submit the form or allow the default behavior
} });
}
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 02:45 AM
hi @Bhavya11 - conditions are meeting property, but it is not preventing the page to save from
Following part is not working: