LightningFlowComponents
LightningFlowComponents copied to clipboard
*CheckValidation* - DuplicateRuleHeader
The check for duplicates works if set to true, but if set to false the code seems to be defaulting to allowSave=false making duplicate rules still fire even if you ask it not to. I'm running v1.5 but 1.6 looks the same.
Steps to reproduce
Steps to reproduce the behavior:
- create a duplicate rule
- set check duplicate rules to false
- intentionally insert a duplicate
- See error
Expected behaviour
If the check for duplicates is set to false, the duplicate rule should not fire.
Actual behaviour
The duplicate rule fires.
Line 220 (or near there) below seems to be setting the dml.DuplicateRuleHeader.allowSave to false, or maybe it's not set at all.
Database.SaveResult[] srListInsert = Database.insert(insertCollection, false);
I updated the line to switch from false to dml (the input value) which seems to have resolved the issue.
Database.SaveResult[] srListInsert = Database.insert(insertCollection, dml);
The same seems to apply to updates where switching to this seems to help.
Database.SaveResult[] srListUpdate = Database.update(updateCollection, dml);
I tried and was unable to reproduce this behavior.
@cadillacben , can you provide a login to an org that's demonstrating this behavior?