DisableFeedTrackingHeader

Specifies that changes made in the current call are tracked in feeds.

Use this header if you want to process many records without tracking the changes in various feeds related to the records. This header is available if the Chatter feature is enabled for your organization.

API Calls

convertLead(), create(), delete(), merge(), process(), undelete(), update(), upsert()

Fields

Element Name Type Description
disableFeedTracking boolean If true, the changes made in the current call are not tracked in feeds.

The default is false.

Sample Code—Java

This sample shows how to use the DisableFeedTrackingHeader. It sets this header to true to disable feed tracking and then creates many account records in bulk.

1public void disableFeedTrackingHeaderSample() {
2  try {
3    // Insert a large number of accounts.
4    SObject[] sObjects = new SObject[500];
5    for (int i = 0; i < 500; i++)  {
6       Account a = new Account();
7       a.setName("my-account-" + i);
8       sObjects[i] = a;
9    }
10    // Set the SOAP header to disable feed tracking to avoid generating a
11    // large number of feed items because of this bulk operation.
12    connection.setDisableFeedTrackingHeader(true);
13    // Perform the bulk create. This won't result in 500 feed items, which
14    // would otherwise be generated without the DisableFeedTrackingHeader.
15    SaveResult[] sr = connection.create(sObjects);  
16    for (int i = 0; i < sr.length; i++) { 
17      if (sr[i].isSuccess()) {
18        System.out.println("Successfully created account with id: " + 
19          sr[i].getId() + ".");
20      } else {
21        System.out.println("Error creating account: " + 
22          sr[i].getErrors()[0].getMessage());
23      }
24    }
25  } catch (ConnectionException ce) {
26    ce.printStackTrace();
27  }
28}