Chavan AP
Kilo Sage

Hi All,

In case you are wondering how do I upload an attachment by clicking on a Button in a form please follow below steps:

 

1. Create UI Action:

Navigate to System Defination -> Click on UI Action Module -> Click on Create New

 

2. Fill all the details as below:

find_real_file.png

3. Now on onClick field put below string: 

saveAttachment(g_form.getTableName(), g_form.getUniqueValue());

 

That's All !!

Now whenever you will click in the Upload file button on a form it will give you popup asking for an attachment.

find_real_file.png

 

Do mark it helpful if this will help you in anyway.

Regards,

Ajay

+91-9769949577

Comments
Paul Curwen
Giga Sage

Or even better:

 

1. You could just click the paper clip icon and add the attachments,  which comes out of the box and requires no effort

2. Drag a file onto the form and it will automatically attach

Chavan AP
Kilo Sage

Hi Paul,

 

Definitely even I would recommend everybody to user OOB functionalities but it just a another way to do it.

 

Regards,

Ajay 

vjh_123
Tera Explorer

Is it feasible to develop a custom attachment button for a record that doesn't involve the use of "saveAttachment()"—meaning it won't generate records in sys_attachment and sys_attachment_doc? Additionally, I aim to manipulate the data which is their in the attached document.

Kishor O
Tera Sage

@Chavan AP  How to restrict users to select only the excel or CSV file type in the UI action?

MahendraG233225
Tera Contributor

what about when we have to see that button on the list view 

Version history
Last update:
‎09-18-2019 04:53 AM
Updated by: