- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 01:10 AM
Hi All,
There is a requirement that when we select a perticular assignment group the group manager name should populate in manager field. I have created a manager field. Please suggest me how to autopopulate the name when group is selected.
Regards,
Tejaswini
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 01:46 AM
Hello Tejaswini,
You can also create a BR for before insert, update
Condition:
Hope this will help you.
Kindly mark an answer as correct and helpful if it will resolve your query.
Regards,
Akshata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 01:20 AM
Create a client script onChange of the group field:
(update the fields accordingly if you have other fields)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var group = newValue;
var ga = new GlideAjax('global.customFormUtil');
ga.addParam('sysparm_name', 'getManager');
ga.addParam('sysparm_group', group);
ga.getXMLAnswer(ajaxResponse);
function ajaxResponse(answer) {
var groupObj = JSON.parse(answer);
g_form.setValue('u_manager', groupObj.manager);
}
}
And a Client callable script include:
var customFormUtil = Class.create();
customFormUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getManager: function () {
var groupObj = {};
var group = this.getParameter('sysparm_group');
var grGroup = new GlideRecord('sys_user_group');
if (grGroup.get(group)) {
groupObj.manager = grGroup.getValue('manager');//
}
var userJson = global.JSON.stringify(groupObj);
return userJson;
},
type: 'customFormUtil'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 01:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 05:41 AM
Hi Akshata,
We want it to restict only to a perticular assignment group = major incident group. Only if we select this group the manager field should populate with manager name for other groups it should be empty. Can you please suggest

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 05:58 AM
You need to add one if condition under
if(gr.next())
{
if(ass_group=="sys_id of major incident group")
{
//remaining code will be same
}
}
Regards,
Akshata