How to get attachment count from interaction to service portal request form using client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 11:20 PM - edited 10-31-2022 11:55 PM
I want to get total number of attachments in interaction to request form using catalog client script.
We are creating request from interactions.
I see the table sys_attachment and table_name=interaction^table_sys_id=[Interaction record sys_id]
We get total number of attachments.
But is this the only way or is there any other way to get the attachments count.
I see the manage attachments have total number of attachments can i use this value directly if yes how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 11:31 PM - edited 10-31-2022 11:34 PM
Call the script include in client script using glide ajax
GetAttcahmentCount : function(ID){
var att = new GlideRecord('sys_attachment');
att.addQuery('table_sys_id', ID);
att.query();
return att.getRowCount();
};
Mark correct and helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 11:54 PM
How can i use this in catalog client script?