- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 10:03 AM - edited ‎08-11-2023 10:03 AM
Hi All!
i have a requirement. i want to show the department according to the user.
i am using the below code:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var c=g_form.getReference('assigned_to',val2);
function val2(data){
g_form.setValue('department',data.parent);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 05:03 AM
Hi @Balbir_Singh, try this callback function.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var data=g_form.getReference('assigned_to',val2);
function val2(data){
g_form.setValue('variable_name',data.department); // write variable's name here
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2023 07:21 AM
Please try the below syntax and then use SetValue.
var assignedToDepartment = g_form.getReference('caller_id').department;
alert(assignedToDepartment);
Please mark it Correct and Hit Like if you find this helpful!
Regards,
Karthiga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 05:03 AM
Hi @Balbir_Singh, try this callback function.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var data=g_form.getReference('assigned_to',val2);
function val2(data){
g_form.setValue('variable_name',data.department); // write variable's name here
}
}