Autopopulate the image

Venky Kshatriy2
Tera Contributor

I am created the one filed in the incident table 

field name : profile image

type: image 

in user table one field is there name is upload image

my requirement is when we are created the incident record we are select the caller right which person we are selected that person image auto populate the our field value(in the incident table).

5 REPLIES 5

Samaksh Wani
Giga Sage
Giga Sage

Hello @Venky Kshatriy2 

 

You need to write onChange Client Script.

 

 

var value = g_form.getValue('caller_id');
var gr = new GlideRecord('sys_user');
gr.addQuery('caller_id', value);
gr.query();

if(gr.next()){
g_form.setValue('profile_image_field_name', gr.image_field_name_of_user_table);
}

 

 

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Venky Kshatriy2
Tera Contributor

Hi 

Samaksh Wani

 I am tried this way its not working .....

Rahul Talreja
Mega Sage
Mega Sage

Hi @Venky Kshatriy2 ,
You need to copy the image onto the Incident table 
Use this:

var donorTable = 'incident';
var donorID = '2b6644b15f1021001c9b2572f2b47763';//sys id of source record
var recipientTable = 'incident';
var recipientID = '78e47fe94f31d200bf004a318110c7d4';// sys id of target record

GlideSysAttachment.copy(donorTable, donorID, recipientTable, recipientID);
Please mark my response correct/helpful as applicable!
Thanks and Regards,
Rahul

Hi @Rahul

Thanks for your reply but I need dynamically not static 

Thanks & Regards