Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

Getting File Attachment Data; Deleting File Attachments With CPHP

$
0
0

Topic by Mike Waldron

Is there a way to get incident file attachment data in CPHP? I'm not talking about the metadata like created date, name, and etc. What I'm interested in is the file's actual data. It's not returned by a standard fetch (Usage on Get is "Not Returned.") This can be done in CWSS with the GetFileData() method, but I need to do it with CPHP. Poring over the documentation, I'm not seeing a way to do it, but maybe I overlooked it. CPHP features makeFile() and setFile() methods that may come in useful, if I can get the data for an attachment that's already present on the incident.

Also, how would one go about deleting file attachments from an incident with CPHP? Here's what I've already tried:

  1. Setting Incident.FileAttachments to a new, empty FileAttachmentIncidentArray. This seems to work in the custom process's test harness, but apparently does nothing on a real incident.
  2. Setting Incident.FileAttachments = null. This threw an exception.
  3. Replacing an existing file attachment with a new one, using the sample code from the documentation. This was additive - both the old and the new file attachments were present.

Is it possible to delete a file attachment from an incident using CPHP?


Viewing all articles
Browse latest Browse all 2504

Trending Articles