Script Include returning null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 01:26 AM
I want a project account from employee table to catalog form
whenever a user logs in his project account should be populated
Client script
function onLoad() {
//Type appropriate comment here, and begin script below
alert("hello script include");
var user = g_form.getValue('requested_by');
alert(user); // returning sys_id
var ga = new GlideAjax('ProjectAccount');
ga.addParam('sysparm_name','callback');
ga.addParam('sysparm_user','user');
ga.getXML(getDetails);
function getDetails(response){
var answer = response.responseXML.documentElement.getAttribute('answer');
alert(answer); // returning null
g_form.setValue('current.variables.project_account',answer);
}
Script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 11:51 PM
@Vijay485 ,Thanks for marking my answer as helpful. If it helped you in any way please accept the solution so that it will be beneficial to the future readers with the same query.
