
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2015 04:21 AM
I'm a bit baffled as to where the code-behind is for the attachment ui page when initiated.
I found the Script Include, "AttachmentAjax", that handles the actual updating and processing of an attachment. I've scoured through and tested each function of the Client Script section of the attachment UI page, but I just don't see where the call is to first query the sys_attachment table.
Visual Example:
I have a link on a UI page:
The link calls this function:
The "attachment" UI Page came built in with ServiceNow (Eureka). Like I've mentioned though, I've gone over the attachment ui page line by line and I don't see any ajax calls or any functions that, upon loading, go and get current attachments, but it does. Where is this code?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2015 08:10 PM
Hi David,
Far down in the code you will find a line like this:
<g2:attachment_list sys_id="${jvar_target_sys_id}" table="${jvar_target_table}">
That calls an extension to Jelly which takes as input the sys_id and table of the record that you're on when you open the dialog. It calls new SysAttachment();
sa.getAttachments(table, sys_id);
That gets Attachments for all of the records for that given table, and puts it into a variable that is used in the next line of that page:
<g2:for_each_record file_variable="sys_attachment" var="attachment">
This loops over all of those attachments and outputs the HTML you see below *that*- an input button, and then a UI Macro (attachment_entry).
I hope that's helpful
Cory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 03:26 AM
Hi Arnab,
Can you please let me know the script for UI page to parse excel to Catalog item form??
Actually i have same requirement, to parse excel from UI page and user will attach excel on catalog item form and then On submission of catalog item form the record present in excel will be trigger to Datasource of "cmdb_ci_server". And will update the records.
Many Thanks,
Anupam.