Created
May 12, 2016 12:41
-
-
Save lfreeland/b6497199237aee761a6a8a82bce7417f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public List<Database.upsertResult> upsertWorkaround(String sobjectType, List<SObject> recordsToUpsert, Schema.SObjectField externalIdField, Boolean allOrNothing) { | |
| if (sobjectType == 'Account') { | |
| return Database.upsert((List<Account>) recordsToUpsert, externalIdField, allOrNothing); | |
| } | |
| if (sobjectType == 'Contact') { | |
| return Database.upsert((List<Contact>) recordsToUpsert, externalIdField, allOrNothing); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment