- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2019 10:24 AM
Hi,
I have written catalog script and script include. While submitting form without checking attachment the form is getting submitted.
Screenshots of client script and Script Include is attached below:
Please help me where my code is getting wrong.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2019 11:01 AM
Just give me 10 minutes, I am doing corrections
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2019 10:44 AM
Yes u added "" and i also did active script.Yet request is getting submitted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2019 10:47 AM
I have tested the similar code and its working. Can you paste a code? Dont paste a screenshot.
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2019 10:48 AM
var checkattachment = Class.create();
checkattachment.prototype = Object.extendsObject(AbstractAjaxProcessor, {
attachment: function(){
var check = this.getParamater('sysparam_ga');
if(check == 'true'){
var cat_id = gel('sysparm_item_guid').value;
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "sc_cart_item");
gr.addQuery("table_sys_id", cat_id);
gr.query();
if (!gr.next()) {
gs.addInfoMessage("You must attach document before submitting the form.");
return false;
}
}
},
type: 'checkattachment'
});
function onSubmit() {
var ga = g_form.getValue('sysparm_item_guide');
var ab = new GlideAjax('checkattachment');
ab.addParam('sysparm_name', "attachment");
ab.addParam('sysparm_ga', ga);
ab.getXML(checking);
function checking(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
if(answer == true){
return true;
}else if(answer == false){
return false;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2019 11:01 AM
Just give me 10 minutes, I am doing corrections
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2019 11:02 AM
Alright!