Some Weird issue in script include while geting the parameters value

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 03:05 AM
Hello Below is the script include
var getD = Class.create();
getD.prototype = Object.extendsObject(AbstractAjaxProcessor, {
initialize: function()
{
var use = this.getParameter('sysparm_user_name');
var userrrr = this.getParameter('sysparam_tery');
gs.info("manager----"+use);
gs.info('Rahul coming---'+userrrr);
return true;
},
type: 'getD'
});
The below is the client script
The below is the client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('getD');
ga.addParam('sysparm_name','initialize');
ga.addParam('sysparm_user_name',newValue);
ga.addParam('sysparam_tery','Rahul');
ga.getXMLAnswer(gaResponseParse); // Call the response parser function
function gaResponseParse(answer) {
alert("Hello Response: " + answer); // Display the returned answer
}
}
can you let me know what is wrong i am getting the gs.info values from the script include is undefines
The script include is already client callable checked.
can you let me know what is wrong i am getting the gs.info values from the script include is undefines
The script include is already client callable checked.
@Ankur Bawiskar if you can let me know what is wrong will be helpful
@
@
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 03:20 AM
Hi,
Initialize is a constructor function, which is used to initialize objects in your script.
You cant call that from client side.
Use this
Script include
var getD = Class.create();
getD.prototype = Object.extendsObject(AbstractAjaxProcessor, {
myFunction : function()
{
var use = this.getParameter('sysparm_user_name');
var userrrr = this.getParameter('sysparam_tery');
gs.info("manager----"+use);
gs.info('Rahul coming---'+userrrr);
return true;
},
type: 'getD'
});
Client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('getD');
ga.addParam('sysparm_name','myFunction');
ga.addParam('sysparm_user_name',newValue);
ga.addParam('sysparam_tery','Rahul');
ga.getXMLAnswer(gaResponseParse); // Call the response parser function
function gaResponseParse(answer) {
alert("Hello Response: " + answer); // Display the returned answer
}
}
-Anurag
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 03:24 AM
Write new function in script include instead of intilaize..and call it from glideajax in sysparam_name