- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2020 08:54 AM
Hello,
I have a client script that calls a script include. I don't need a response from the script include to be returned to the client script. How can I just execute the GlideAjax? should I just add a query() at the end? (See code below)
var gaFirst = new GlideAjax('createOnboardingUser');
gaFirst.addParam('sysparm_name', 'create_user');
gaFirst.addParam('sysparm_first', first);
gaFirst.addParam('sysparm_last', last);
gaFirst.addParam('sysparm_email', email);
gaFirst.addParam('sysparm_manager', manager);
gaFirst.addParam('sysparm_title', title);
gaFirst.getXMLAnswer(_handleResponse2); // Should I change this to gaFirst.query(); I dont need the GlideAjax to return a response, I just need it to execute
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2020 09:20 AM
Hi,
if you don't want anything to be returned then from script include you can have the function with no code inside it
function _handleResponse2(answer){
// do nothing
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2020 09:10 AM
Hi JJG,
Can you share how your Script Include looks like? And is the create_user function in your Script Include reached at all?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2020 09:20 AM
Hi,
if you don't want anything to be returned then from script include you can have the function with no code inside it
function _handleResponse2(answer){
// do nothing
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2020 02:43 AM
Hi
Have a look at the following article:
You will need the "response" function, but you can leave it empty.
Let me know, if that answers your question.
BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2020 06:27 AM
HI,
In script include function don't do anything
create_user : function()
{
return "";
}
In client side do this
var gaFirst = new GlideAjax('createOnboardingUser');
gaFirst.addParam('sysparm_name', 'create_user');
gaFirst.addParam('sysparm_first', first);
gaFirst.addParam('sysparm_last', last);
gaFirst.addParam('sysparm_email', email);
gaFirst.addParam('sysparm_manager', manager);
gaFirst.addParam('sysparm_title', title);
gaFirst.getXMLAnswer(_handleResponse2);
function _handleResponse2(response)
{
var answer= response;
}
Thanks,
Kunal