Custom "Attachment Dialog"

ipt_meu
Kilo Contributor

Hi all,

I have to modify the default upload to the "sys_attachment" table in ServiceNow. We're using scoped apps and I don't want to affect other apps which are using the default upload dialog as well. The upload dialog is written in Jelly (UI Page). Is there a way to create a second upload function or UI Page with some custom changes in the dialog box? (I need a field: documenttyp - and I need it in the DIALOG (must)). Or are there any best practices/ideas? I tried to copy the default attachment UI Page but when I call it via GlideDialogWindow the dialogbox is empty.

Thanks in advance

1 ACCEPTED SOLUTION

Hi Max,



Loading attachment through GlideDialogWindow here is the script



var sysId = g_form.getUniqueValue(); // sysId of the record to which attachment is to be added


var tableName = 'incident'; // table name give as per your table name


var dialog = new GlideDialogWindow("attachment2");


dialog.setTitle("Add Attachment");


dialog.setPreference("target_sys_id",sysId);


dialog.setPreference("target_table",tableName);


dialog.render();



Mark Correct if this solves your issue and also hit Like and 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

6 REPLIES 6

Hi,

The above example was for calling attachment from some UI action I guess

Regards

Ankur

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

Hi Max,



Can you also mark answer as helpful and hit like. Thanks in advance.



Regards


Ankur


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