Attachments on a contact page

Document ID : KB000098289
Last Modified Date : 29/05/2018
Show Technical Document Details
Issue:
Unable to open the attachments that are added to Contact object which is customized feature extended from Configuration Item.
Environment:
CA Service Desk Manager 14.1
CA Service Desk Manager 17.1
Cause:
Identified some vulnerabilities issue on "Service Desk Repository Type" for attachments. The code(CI Code) was updated accordingly, and prevented this moving the code base to executable's and encrypted spell files.
Resolution:
Important!: Please note this is out of support scope and provided on individuals benefit for code extension from one object to another (Customization)
Note: This is additional information after the initial customization required/implemented for the feature extension from Configuration Item (CI) to Contact (Cnt) Object

Below is a workaround for a case to case scenario. Follow the below changes you need to extend the attachments to a different object 

1. Create a new Repository if necessary (Existing Repository can also be used)
2. Update repository type from "Service Desk Attachments" to "Knowledge" or "Images". 
3. Move all the attachments of contacts from "ServiceDesk" repository to new repository (Optional)

Note: Find all the attachments linked to contact from the below command 
"bop_odump domsrvr zlrel_attachment_cnt "" attmnt.attmnt_name"

4. Update the xx_attmnt_tab.htmpl file accordingly to reflect the code changes present in \\install_dir\site\mods\www\htmpl\web\analyst\xx_attmnt_tab.htmpl file. 

Identify the below code fragments and change accordingly: 
From:

function do_attach_doc() { 
var add_file_src = "View=Upload+ShowFields=Yes+ShowImgStatus=Yes+ShowRepList=Yes+RepType=0+KEEP.POPUP_NAME=" + top.name + 
"+KEEP.PARENT_DIV=" + window.frameElement.parentNode.id + "+KEEP.attmnt_parent=$args.persistent_id"; 
AddFile(0, 0, 0, add_file_src, 50 ); 

 
To:
 
function do_attach_doc() { 
if ("$prop.factory" == "cnt") { 
var add_file_src = "View=Upload+ShowFields=Yes+ShowImgStatus=Yes+ShowRepList=Yes+RepType=2+KEEP.POPUP_NAME=" + top.name + 
"+KEEP.PARENT_DIV=" + window.frameElement.parentNode.id + "+KEEP.attmnt_parent=$args.persistent_id"; 


else{ 
var add_file_src = "View=Upload+ShowFields=Yes+ShowImgStatus=Yes+ShowRepList=Yes+RepType=0+KEEP.POPUP_NAME=" + top.name + 
"+KEEP.PARENT_DIV=" + window.frameElement.parentNode.id + "+KEEP.attmnt_parent=$args.persistent_id"; 
AddFile(0, 0, 0, add_file_src, 50 ); 
Additional Information:
Note: The code has a fixed value i.e. '2' which represents the 'repository type' i.e. 

'2' = Knowledge attachments. 
'0' = Service Desk Repository 

It can be accordingly based on your requirement.

IMPORTANT! - Out of Support Scope.