- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2022 03:42 AM
Hello Everyone!
I have a query, I want to put validation on submit button whenever the user clicks on submit on catalog form I need to check that software details are available on the table or not if yes then return true or return false.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2022 04:19 AM
var ga = new GlideAjax('HelloWorld'); //this is your script include name
ga.addParam('sysparm_name', 'helloWorld'); //this is your function in script include
ga.addParam('sysparm_user_name', "Bob"); //parameter being passed
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer); } //you cvan return true/false from script include which will be recieved here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2022 03:48 AM
Hi,
Hi, usually any action on the submit goes in onsubmit client script. However, if you try to look up data on the table, like GlideAjax, then onsubmit script has issues with Asynch calls, so either make the call synchronous OR write an Before Insert BR and do the same.
Also , your software should be a reference field, so if user has selected it , it should be present in the table. If its not a reference field, then this validation should happen on change of this field, as in when the user enters this detail and not on submit.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2022 04:05 AM
Hello Anurag,
I want to do this with the help of catalog client script and script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2022 04:12 AM
i wrote a lot of things, but if you are adamant on this(which is not the best way) then write an onsubmit client script and call the scripts include using GlideAjax, use getXML
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2022 04:14 AM
can you show me with an example. that will be helpful for me.