Skip to main content
added 360 characters in body
Source Link
user39399
  • 1.1k
  • 1
  • 11
  • 17

I think you can bypass duplicate check with DMLOptions.DuplicateRuleHeader Class: documentation

Sample:

Database.DMLOptions dml = new Database.DMLOptions();
dml.DuplicateRuleHeader.AllowSave = true; 
Account duplicateAccount = new Account(Name='dupe'); 
Database.SaveResult sr = Database.insert(duplicateAccount, dml); 
if (sr.isSuccess()) {   
 System.debug('Duplicate account has been inserted in Salesforce!'); 
}

I think you can bypass duplicate check with DMLOptions.DuplicateRuleHeader Class: documentation

I think you can bypass duplicate check with DMLOptions.DuplicateRuleHeader Class: documentation

Sample:

Database.DMLOptions dml = new Database.DMLOptions();
dml.DuplicateRuleHeader.AllowSave = true; 
Account duplicateAccount = new Account(Name='dupe'); 
Database.SaveResult sr = Database.insert(duplicateAccount, dml); 
if (sr.isSuccess()) {   
 System.debug('Duplicate account has been inserted in Salesforce!'); 
}
Source Link
user39399
  • 1.1k
  • 1
  • 11
  • 17

I think you can bypass duplicate check with DMLOptions.DuplicateRuleHeader Class: documentation