populate caller field value

abhisek
Tera Contributor

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?

4 REPLIES 4

Anurag Tripathi
Mega Patron
Mega Patron

Hey mate, is this just for learning purpose or this is the actual business requirement?

-Anurag

swathisarang98
Giga Sage
Giga Sage

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
   
}

 

swathisarang98_0-1716997771051.png

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

Hi @swathisarang98 

The above script is not working.

Thanks&Regards,

Abhisek Chattaraj.

@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