Newer Version Available

This content describes an older version of this product. View Latest

DisableFeedTrackingHeader

The DisableFeedTrackingHeader header specifies whether the changes made in the current call are tracked in feeds. A user can subscribe to a record or to another user. Changes to the record and updates from the users are displayed in the Chatter feed on the user's home page, which is a useful way to stay up-to-date with other users and with changes made to records in Salesforce.

Use this header if you want to process a large number of 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. For more information on Chatter, see “Chatter Overview” in the Salesforce online help.

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 a large number of accounts in bulk.

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