Created
May 12, 2016 12:42
-
-
Save lfreeland/d86a9061d437eef9d1b21bf079ad7608 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); | |
| } | |
| // etc | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment