- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2017 08:52 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 12:02 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2017 11:58 PM
Hi Max,
So you need your own custom attachment ui page which you want to call from where?
Can you explain more on this and also share the code snippet which is causing issue to you.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 12:01 PM
Hey Ankur
I just cloned the ui page "attachment" (from the Jakarta instance) to "attachment2". Then I added a button to call this "attachment2" ui page with the following code:
var dialog = new GlideDialogWindow("attachment2");
But the dialog is empty.
Are there any other solutions to add attachments with a custom dialog?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 12:02 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2018 09:35 PM
Hi can you please explain me where I have to put this code and how to cal this.. I have just cloned already available attachment code and renamed. I have to add that new attachment window to change request form. Can you please guide me?