Auto populate field in catalog item not visible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 06:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 07:00 AM
Hello @shaikkhasim
Plz find the link below :-
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 07:13 AM
Hi @shaikkhasim ,
Auto populate tab is available from Utah version. As you are in Tokyo version it is not available. If you want to auto populate you can use GlideAjax or lookup select box type variable.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 05:38 PM
Hi @Danish
will you pls share the images , how can i Autopupulate the filed with the help of Glide Ajax or Look up select box
Regards
khasim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 07:44 PM
Hi @shaikkhasim ,
Here is the solution to this -
Create a new client callable script include with following function
var UserDetails = Class.create();
UserDetails.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getUserInfo: function() {
var details = {};
var userId = this.getParameter('sysparm_user_id');
var userObj = new GlideRecord('sys_user');
userObj.addQuery('sys_id', userId);
userObj.query();
if (userObj.next()) {
details.email= userObj.email_id.toString();
}
return JSON.stringify(details);
},
type: 'UserDetails'
});
Create a new catalog client script on the record producer/request form
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ajax = new GlideAjax('UserDetails');
ajax.addParam('sysparm_name', 'getUserInfo');
ajax.addParam('sysparm_user_id', g_form.getValue('employee_name')); // change variable name here
ajax.getXML(doSomething);
function doSomething(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
var answers = JSON.parse(answer);
g_form.setValue('var_email_id', answers.email.toString()); // change variable name here
}
}
Thanks,
Danish