Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 01:09 PM
Script Include:
var AUtils = Class.create();
AUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
checkEmail: function() {
var email1 = this.getParameter('sysparam_useremail');
var uprofile = new GlideRecord('sys_user');
uprofile.addQuery('email', email1);
uprofile.query();
if (uprofile.next()){
answer = true;
} else answer = false;
return answer;
},
type: 'AUtils'
});
Client scripts:
var ap = new GlideAjax('AUtils');
ap.addParam("sysparam_name", "checkEmail");
ap.addParam('sysparam_useremail', email_d);
ap.getXML(EmailResponse);
}
function EmailResponse(response) {
if(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
if(answer){
var data = JSON.parse(answer);
}
else alert("No answer");
}
I keep getting null value. Not sure what is wrong. Any ideas?
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 02:01 PM
Hi @samadam ,
Everything is fine in ur client & server script except u just need to replace "sysparam" with "sysparm". Post replacing it on both client & script include it should work.
Thanks,
Danish
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 02:06 PM
No worries. Cheers!!