Skip to content

Instantly share code, notes, and snippets.

@Aupajo
Last active October 20, 2015 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aupajo/eb43a0811a8c73a5933a to your computer and use it in GitHub Desktop.
Save Aupajo/eb43a0811a8c73a5933a to your computer and use it in GitHub Desktop.
Salesforce Recent Items bug

Steps to reproduce

  1. Build up a Recent Items history by visiting different objects (Contacts, Cases, etc.)
  2. Create at least 10 objects during a test run (see example code below)
  3. Initiate a test run
  4. Wait for test run to finish
  5. Visit the Home tab

Expected: Recent Items remains unchanged

Actual: Recent Items is cleared

@isTest public class ExampleClassTest {
  @isTest
  public static void testRecentItemsBug() {
    for(Integer i = 0; i < 10; i++){
      Contact c = new Contact(LastName = 'Test' + String.valueOf(i), Email = 'test' + String.valueOf(i) + '@test.com');
      insert c;
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment