on load client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 06:30 AM
hello every I struck while onload client script
I'm getting the desired result with this script
desire result should be
pls help me....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 09:09 AM
@Anjali yadav1 Please use the below script to populate the values,
If caller is auto-populated then onLoad client script.
function onLoad() {
//Type appropriate comment here, and begin script below
var caller = g_form.getReference('caller_id', setLocation);
function setLocation(caller) {
if (caller)
g_form.setValue('location', caller.location);
g_form.setValue('department', caller.department);
//Add your necessary fields to set the value
}
}
If caller is changed then its onChange client script,
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var caller = g_form.getReference('caller_id', setLocation);
}
function setLocation(caller) {
if (caller)
g_form.setValue('location', caller.location);
g_form.setValue('department', caller.department);
}
Result :
Please mark this as helpful and accept it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 09:34 AM
Hi @Anjali yadav1 ,
Can you please try this script
g_form.setValue('u_caller', g_user.userId)
var userref = g_form.getReference('u_caller', userLookup);
function userLookup(userref){
g_form.setValue('location', userref.location.toString());
g_form.setValue('location', userref.email);
g_form.setValue('location', userref.department);
g_form.setValue('location', userref.location.toString());
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak