You need to sign in to do that
Don't have an account?
Sathia Aran 9
DMLOptions not working for upsert operation
I added the below lines of code for upsert operation to record the duplicate record set.But I face compile time error .Please note that the dmloptions work for database.insert and database.update.Please help
Lines of Code:
Database.DMLOptions dml1 = new Database.DMLOptions();
dml1.DuplicateRuleHeader.AllowSave = true;
Database.upsert(lstOfEqup1, dml1);
Error message :
Method does not exist or incorrect signature: void upsert(List<Account>, Database.DMLOptions) from the type Database
Lines of Code:
Database.DMLOptions dml1 = new Database.DMLOptions();
dml1.DuplicateRuleHeader.AllowSave = true;
Database.upsert(lstOfEqup1, dml1);
Error message :
Method does not exist or incorrect signature: void upsert(List<Account>, Database.DMLOptions) from the type Database
public static Database.UpsertResult[] upsert(sObject[] recordsToUpsert, Schema.SObjectField externalIdField,Boolean allOrNone)
Refer the following link for more information:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database.htm