How to copy the attachment from table record to record producer using UI action

Community Alums
Not applicable

Hi Experts,

 

I was trying to attach the files of incident record to record producer on click of UI button.

 

I've tried 'GlideAttachment.copy()' which helps only from record to record, but not record to form.

 

Can you please advise, how to make this work.

 

Thanks in advance..!!

 

Regards,

Naveen.

1 ACCEPTED SOLUTION

@Community Alums 

do this

1) create a string variable on record producer and give it higher order

2) pass the incident record sysId from URL parameter when you redirect user to record producer

3) use onLoad catalog client script and get that URL parameter value and set it in variable and hide it

4) then use Record producer script to copy attachment

GlideSysAttachment.copy('incident', producer.variableName, 'target_table', current.sys_id);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

17 REPLIES 17

@Community Alums 

do this

1) create a string variable on record producer and give it higher order

2) pass the incident record sysId from URL parameter when you redirect user to record producer

3) use onLoad catalog client script and get that URL parameter value and set it in variable and hide it

4) then use Record producer script to copy attachment

GlideSysAttachment.copy('incident', producer.variableName, 'target_table', current.sys_id);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Community Alums 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

Hi @Ankur Bawiskar ,

 

Thanks for your help and guiding me through the alternate solution..!!

 

Regards,

Naveen.