Delete Attachments

This topic shows how to delete attachments using Import Management. You can delete attachments associated with any supported object.

Before You Start

To delete attachments during an import activity, you need the source object ID (either the parent public unique identifier or the primary key).

Steps to Retrieve the Source Object IDs

  • Run a GET query on the source object (with valid filter criteria) to obtain the correct source object keys (such as public unique identifier, primary key and so on). For example, you can retrieve PartyNumber and Party ID of the account object using GET query on the account object.

  • Alternatively you can submit an export activity using Export Management on the source object (with valid filter criteria) to obtain the correct Source object keys.

Delete Attachments Using Import Management

To delete attachments using Import Management:

  1. Create an import activity as described in the topic Import Data.

  2. Enter a name for your import. In the Object drop-down list select Attachment.

  3. In the Attachment Object drop-down list, select the object associated with the attachment.

  4. Select the ZIP file that contains the attachment files and the source data file with the object records information for which you want to delete the attachment.

  5. Click Advanced Options and under the Import Options section, select Delete records from the Import Mode drop-down list.

  6. The ZIP file must contain at least a file named Attachment.CSV, and optionally one or more attachment files. The Attachment. CSV file has the following format:

    Pk1Value

    ObjectPuid

    FileName

    300100111735265

    N/A

    ReadMe.txt

    N/A

    CDRM_L1011

    N/A

    300100111735265

    N/A

    N/A

    N/A

    CDRM_L1212

    Template.txt

    Pk1Value and ObjectPuid column values uniquely identify an existing object record. FileName indicates the name of attachment files to delete during the import.

    You can associate an attachment only with an existing object record. A single record can be associated with multiple attachments by having multiple rows in the CSV file. There's no limit on the number of attachments that can be deleted in a single import job. However, the size of the attachment ZIP file can't exceed 250 MB.

    Note: You can pass either the Primary key or the Public Unique Identifier, but not both for an object record.
  7. Click Next and map the source and target attributes.

  8. Click Next to navigate to the Review and Submit page. Review the import activity configuration and click Submit to activate the import. You can view the status of the submitted import on the Manage Imports page.