OnClick of Attachement Button

Markell
Tera Guru

Hi Guys

The basics of what i am trying to do i simply show a custom Message when a user clicks on the Attachment paperclip icon.

I'm guessing this would be done via a UI Action, but I don't know how to access or call the Attachment button. 

I've tried using Google developer view to find out but no luck.

 

Has anyone done this before or even just know what the 'value' of that Icon is?

If you know where I can access the original onClick script for the attachment Icon (there must be one to fire the attach file feature) that would be helpful also 🙂

 

Thanks in Advance

1 ACCEPTED SOLUTION

Hi Markell,

you can check the attachment ui page. but since you want to add some custom text besides choose file button you need to copy that ui page and name as per your wish and call that ui page or else it would be global change.

Where are you stuck?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

18 REPLIES 18

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Markell,

I don't think this would work. You can call attachment dialog box using ui action code. but clicking on paper clip icon showing message would be difficult.

have client side ui action and in onclick add this

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

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur no luck just yet but thanks.

 

I guess onclick may not work maybe 'OnChange'. Its a annoying I cant just get that button value lol

Hi Markell,

you want attachment dialog to open when UI action is clicked?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Yes this is what I am trying to do.

When the Attachment Icon 'Paper clip' find_real_file.png is clicked I would like to have an alert or 'dialog' show either before the usual attachments dialog, or edit the attachment dialog somehow:

 

find_real_file.png

 

What would work for me is the ability to put a sentence before the 'Choose file' find_real_file.png button. 

But still, I would need to have the onClick Script so I could run some script to decide when to show the new sentence.

 

Hope I am making sense lol