Adding Date and Time in Manage Attachment ?

Ibaa_Shoheb
Tera Contributor

Hello Team,

At the moment, we do not have an option in “Managed Attachments” to identify the timing as to when we received an attachment in our environment.

Is it possible to have the arrival time stamp appended to the Attachment file name ? 

find_real_file.png

Regards,

Shoheb Shaikh

14 REPLIES 14

Ujjawal Vishnoi
Mega Sage
Mega Sage

Hi Shoheb,

For this you will have to modify the ui page named as 'attachment'. You can get the created time from sys_attachement table and can show on page.

 

Hope this helps.

Regards

Ujjawal

HI, 

Could you let me know more about modifying the UI attachment page to get date and time?

Thanks. 

Milind
Kilo Contributor

Hi Shoeb,

Try following script to update file names. You can use it in BR or anywhere else you want.

// script to update file names of attached files.
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name', '<table name>');
gr.addQuery('table_sys_id', '<sys id of the record to whome attachments present>');
gr.query();

while (gr.next()) {
// get date and file name.
var gdt = gr.getValue('sys_created_on');
var fileName = gr.getValue('file_name');

// create new name for file
fileName += '-' + gdt;

// set name to file and update record.
gr.setValue('file_name', fileName);
gr.update();
}

Thanks,

Milind

Ibaa_Shoheb
Tera Contributor

Hello All,

 

I just added a small script in UI macro attachment_entry and was able to get the desired output.

 

Script: ${sys_attachment.sys_created_on.getDisplayValue()}

 

Regards,

Shoheb Shaikh