populate caller field value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 07:47 AM - edited 05-29-2024 07:48 AM
I have a string field on incident form.
I want to populate the caller field value on that string field on the incident form when caller field value is cahnged or incident form is loading.
Can anyone please let me know how can I achieve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 07:58 AM
Hey mate, is this just for learning purpose or this is the actual business requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 08:50 AM
Hi @abhisek ,
You have to write both Onchange client script as well as onload client script to populate string value, you can do this through 2 ways one is through calling script include and another is using getReference method as shown below,
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var abc = g_form.getReference('caller_id', currentUser1); // caller_id backend name
return;
}
function currentUser1(abc) {
g_form.setValue('u_caller_id_name', abc.name); // string field backend name
}
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 08:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 08:11 AM
@abhisek what is the error you are getting ?
Could you please share some screen shot or what you have tried so far /
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang