Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Autopopulate Group name when user is selected in requested for

kamlesh
Tera Contributor
 
12 REPLIES 12

Hi @kamlesh ,

 

Click on search icon where it showing dates, right click on any column header n select list layout bring in the Group Column on the right hand side & move the Created column on the left hand side.

 

Thanks,

Danish

 

ersureshbe
Giga Sage

Hi, Did you try 'g_form.getReference()' function to auto-populate the value using the catalog client script.?

Regards,
Suresh.

 

Yeah below is my script

 

function onLoad() {
g_form.addOnChange('requested_for', function() {
var requestedFor = g_form.getValue('requested_for');


if (requestedFor) {
g_form.getReference('requested_for', function(userRecord) {

var userGroups = userRecord['user_groups'];

g_form.setValue('my_group', userGroups);
}, 'sys_user_group', 'user_groups');
} else {
g_form.setValue('my_group', '');
}
});
}