DeleteAttachment Functions
The DeleteAttachment and DeleteAttachmentSession functions delete a specified file from a specified Attachments field in a specified table record. These two functions differ only in respect to parameters for login. For more information, see Login Parameters.
Syntax
The following is the syntax for an HTTP request:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/DeleteAttachment HTTP/1.1
Host: HostName
Content-Type: application/x-www-form-urlencoded
Content-Length: length

UserName=string&Password=string&GroupName=string&ProjectName=string&SystemName=string&Table=string&Identifier=string&AdditionalIdentifier=string&AttachmentFieldName=string&AttachmentName=string
Parameters
In addition to login parameters, both the DeleteAttachment and DeleteAttachmentSession functions use these parameters:
ProjectName—The name of the Windchill Risk and Reliability Project. This value is case-sensitive.
SystemName—The name of the System file. This value is case-sensitive.
Table—The name of the Windchill Risk and Reliability table in which the record is located. This value is case-sensitive.
Identifier—The identifier of the record that you want to modify. This value is not case-sensitive.
AdditionalIdentifier—The second identifier of the record that you want to modify. This parameter is only required for the FMEA Worksheet table. For this table, you must specify the level of the FMEA data. This value is not case-sensitive. Depending on your FMEA data structure, the value can be one of the following: Item, Mode, Cause, Effect, or Action. If custom labels are assigned to data levels in the properties for the Project’s FMEA Design file, you can also use these values.
AttachmentFieldName—The name of the Attachments field with the file that you want to delete. This value is case-sensitive.
AttachmentName—The name of the file that you want to delete. You can use ReadRecord functions to read the data in an Attachments field. The returned values are the file names in a semicolon-separated list. For example, assume that the following values are returned for an Attachments field with three attached files: file1.txt; myimage.png; spreadsheet.xlsx
The following is an example of an HTTP POST request:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/DeleteAttachment
HTTP/1.1Host: test
Content-Type: application/x-www-form-urlencoded
Content-Length: length
UserName=Bill&Password=passwd&GroupName=Manager&ProjectName=Tablet PC &SystemName=Tablet PC&Table=System Tree Items&Identifier=System25& AttachmentFieldName=User Attachments 1&AttachmentName=flowchart.jpg
Returns
If the user is authenticated and the specified parameter values are found, the attachment is deleted and ‘true’ is returned.
<?xml version="1.0" encoding="utf-8"?>
<DataEngineResponse xmlns="http://tempuri.org/">
<Success>true</Success>
</DataEngineResponse>
If the call fails, the AdditionalData tag provides the reason for the failure.
If the provided file name matches more than one of the attachments, the first one shown in Windchill Risk and Reliability is deleted.