How to Auto populate Assignment group when we select category and Sub-Category in catalog. I tried
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 12:21 AM
How to Auto populate Assignment group when we select category and Sub-Category in catalog. I tried with catalog client script and script include but not populating.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
if(g_form.getValue('sub_category')==''){
return;
}
var Assignment_Group = new GlideAjax('getTitle');
getAssignment_Group.addParam('sysparm_name', 'getAssignment_Group');
getAssigment_Group.addParam('sysparm_user_id', newValue);
getAssignment_Group.getXML(setAssignment_Group);
function setTitle(response){
var answer = response.responseXML.documentElement.getAttribute('answer');
g_form.setValue(('job_Assignment_Group', answer));
}
}
script include :
var GetAssignment_Group = Class.create();
GetAssignment_Group.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getAssignment_Group : function(){
var user_id = this.getParameter('sysparm_user_id');
var grUser = new GlideRecord('sys_user');
grUser.addQuery();
if(grUser.next()){
return grUser.getValue('Assignment_Group');
}
},
type: 'GetAssignment_Group'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 01:16 AM
Hi @Tulasiram1 ,
In your client script you are calling a class 'getTitle' But your script include name is GetAssignment_Group. And you are trying to get assignment_group field value from user record, Do you have that field on user table?
Could you please elaborate your requirement what you are trying to achieve?
Thanks,
Gopi
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 01:17 AM
Hi @Tulasiram1 ,
In Client script, try to use alert function to debug. Check if you're getting response from the script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 02:07 AM
Hello @Tulasiram1 How are you ?
Please elaborate your requirement clearly so that i can help you. There is no assignment group field in user table. please mention the fields that you are using to auto populate the assignment group. what is the dependent value .
Please mark it helpful if it help you
Thanks and regards
Uday Kumar Valapudasu