Newer Version Available

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

MruHeader

In API version 7.0 and later, the create(), update(), and upsert() calls do not update the list of most recently used (MRU) items in the Recent Items section of the sidebar in the Salesforce user interface unless this header is used. Be advised that using this header to update the Recent Items list may negatively impact performance.

Fields

Element Name Type Description
updateMru boolean

Indicates whether to update the list of most recently used items (true) or not (false).

For retrieve(), if the result has only one row, the MRU is updated to the ID of the retrieve result.

For query(), if the result has only one row and the ID field is selected, the MRU is updated to the ID of the query result.

Sample Code—Java

This sample turns on the MRU list update option by setting the MruHeader to true. Next, it creates an account.

1public void mruHeaderSample() {
2  connection.setMruHeader(true);
3  Account account = new Account();
4  account.setName("This will be in the MRU");
5  try {
6    SaveResult[] sr = connection.create(new SObject[]{account});
7    System.out.println("ID of account added to MRU: " + 
8      sr[0].getId());
9  } catch (ConnectionException ce) {
10    ce.printStackTrace();
11  }
12}