- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 10-16-2019 12:11 PM
Custom Attachment button and use it anywhere in the form Using UI Macro and Formatter
Create a UI Macro for an Attachment:
- Navigate to System UI> UI Macros.
- Click New.
- Complete the form.(name it as add_attachment)
- In the XMLscript field enter below Script:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<button type="button" onclick="saveAttachment(g_form.getTableName(), g_form.getUniqueValue())">Attachment</button>
</j:jelly>
Refer below SS:
Create a Formatter :
- Navigate to System UI> Formatters.
- Click New.
- In the Namefield, enter a descriptive name for the formatter.(In our case name would be Attachment on Form)
- In the Formatterfield, enter the name of the UI macro with .xml appended to it. (In our case UI Macro name would be add_attachment)
- In the Table field, select the table in which the formatter will be used.
- In the Type field, select Formatter.
- Click Submit.
Refer below SS:
Yes we are done here , now lets open an Incident form layout and add our Attachment on Form formatter in a form and save it as shown below:
Now in an Incident form you will see the Attachment button as shown below:
When you will click on it , you will be having an ability to attach a file:
I am open for suggestions and improvement so feel free to comment on the article.
That’s all guys, if you find this article helpful please like, share and Subscribe!!
See you
Ajay
+91-9769949577
- 5,916 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
nice doc .. keep it up
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Ajay,
Firstly, thank you for such clear instructions - this works perfectly.
We would really like to implement the same thing on our Catalog item forms on the portal (so the button will appear amongst catalog item varaibles). Do you have an idea as to how we might achieve this?
Rich

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Attachment as variable is available in Paris release.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
We have attachment icon present on almost all the forms both in platform as well portal, so what is the specific need of creating it.
Also save attachment function is that OoB or custom, if so what is the code in it.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Great Document. Can you please help me how to have same functionality in Agent Workspace view? Thanks.