Fetch the manager of the selected assignment group and displays the manager's name as a field messag
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 03:16 AM
Hi everyone,
I wrote this script but still its not working can you please help me on this.
Script----
(function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
// Fetch the assignment group record
g_form.getReference('assignment_group', function(group) {
if (group && group.manager) {
// Fetch the manager record
g_form.getReference(group.manager, function(manager) {
if (manager && manager.name) {
// Display the manager's name as a field message
g_form.showFieldMsg('assignment_group', 'Change Manager: ' + manager.name, 'info');
}
});
} else {
// Clear the field message if no manager is found
g_form.showFieldMsg('assignment_group', 'No manager found for this group', 'info');
}
});
})(g_form.getControl('assignment_group'), g_form.getValue('assignment_group'), g_form.getValue('assignment_group'), g_form.isLoading(), g_form.isTemplate());
Regards
Regards
Jyoti
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 03:21 AM
g_form can only work with fields that are on the form.