How to add custom attachment button on change request form other than given option.

Shilpi Sharma2
Tera Contributor

How to add custom attachment button on change request form other than given option.

1 ACCEPTED SOLUTION

Priyanka136
Mega Guru

Hi Shilpi,

Try this below one , its working fine for me.

You have to write UI Action ("sys_ui_action") table.

1. Name = Attachment

2. Table =change_request

3. Order = 100

4. Active = true

5. Client (checkbox) = True

6. Form button (checkbox) = True

7. Onclick = saveAttachment(g_form.getTableName(), g_form.getUniqueValue());

find_real_file.png

Before UI Action:-

find_real_file.png

After UI Action :-

find_real_file.png

Let me know if you have any questions.

Please mark it Correct or Helpful, if it works based on impact....!!!!

Warm Regards,

Priyanka

find_real_file.png

www.dxsherpa.com

View solution in original post

4 REPLIES 4

Anurag Tripathi
Mega Patron
Mega Patron

You can create a ui action to open a ui page and in the page you can provide way to add attachment.

See this link.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0529497

-Anurag

Hi Anurag,

I want to achieve this functionality on change request form not on service catalog. Please help

Nikhil Pandit
Mega Guru

Hi

U can create formatter for this and write UI macro as

<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<b>Proof of purchase</b><br/>


<a onclick="saveAttachment(g_form.getTableName(), g_form.getUniqueValue())">


<img src="C:/Users/Public/Pictures/Sample Pictures/file-attachments.png" width="30" height="30"/></a>


<b></b>


</j:jelly>

 

Finally, add this formatter using form layout.

 

Priyanka136
Mega Guru

Hi Shilpi,

Try this below one , its working fine for me.

You have to write UI Action ("sys_ui_action") table.

1. Name = Attachment

2. Table =change_request

3. Order = 100

4. Active = true

5. Client (checkbox) = True

6. Form button (checkbox) = True

7. Onclick = saveAttachment(g_form.getTableName(), g_form.getUniqueValue());

find_real_file.png

Before UI Action:-

find_real_file.png

After UI Action :-

find_real_file.png

Let me know if you have any questions.

Please mark it Correct or Helpful, if it works based on impact....!!!!

Warm Regards,

Priyanka

find_real_file.png

www.dxsherpa.com