Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DMLOptions to bypass duplicate rule exceptions #1498

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cfe546b
Use DMLOptions to bypass duplicate rule exceptions
chininchu Sep 27, 2024
a95d789
json files have been reverted
chininchu Oct 3, 2024
bd2f1fb
added the AllOrNothing flag
chininchu Oct 3, 2024
31ec88c
modified
chininchu Oct 3, 2024
86b3c3e
- Implement allOrNothing flag in DMLOptions instance
chininchu Oct 4, 2024
0c63f39
High Ratio Custom Object for Rollup Testing
acrosman Feb 7, 2024
1a84fd0
Rename Custom object file
acrosman Feb 7, 2024
3861c98
Add Standard Object High Ratio Test File
acrosman Feb 7, 2024
8adaff7
Create snowfakeryschema
Nickers3 Feb 6, 2024
3f335d4
Delete datasets/qa/snowfakeryschema
Nickers3 Feb 6, 2024
e188b64
Add files via upload
Nickers3 Feb 6, 2024
058f62a
Delete datasets/qa/SampleStandardObjectLowRatio.txt
Nickers3 Feb 7, 2024
5f836fb
Create snowfakerylowratio
Nickers3 Feb 7, 2024
e9f3070
Rename snowfakerylowratio to snowfakerylowratio.yml
Nickers3 Feb 7, 2024
757c979
Remove extra friends headers
acrosman Feb 7, 2024
c04cb9e
Adding 1 big opp
acrosman Feb 7, 2024
d134e99
Added Fields used to Test DLRS QA Rollups
Nickers3 Feb 7, 2024
1918523
Test for adding DLRS Rollups into QA repo.
Nickers3 Feb 7, 2024
d6b0aa1
Pulling DLRS QA Rollups into QA unpackaged portion of repo to allow f…
Nickers3 Feb 7, 2024
5e3d275
Adding Object Based DLRS Apex Class and Apex Triggers into QA Unpacka…
Nickers3 Feb 7, 2024
5aaf3b0
Pull DLRS Updates post testing
Nickers3 Feb 7, 2024
390e2bb
Add Page Layout changes with new fields and splitting out DRLS Test F…
Nickers3 Feb 7, 2024
96922ac
Ignore Layout and Profile changes
Nickers3 Feb 7, 2024
3659a17
Snowfakery Add
NickersUMN Feb 7, 2024
3a799f2
Update snowfakerylowratio.yml
NickersUMN Feb 7, 2024
20e4e0e
Added field description and help text to reference DLRS rollups that …
Nickers3 Feb 7, 2024
cc414ad
Update API versions to v61.0
aheber Sep 27, 2024
85de930
Massage and convert MDAPI format to DX format
aheber Sep 27, 2024
50b05bc
update cumulusci to correct structure
aheber Sep 27, 2024
60191e3
Merge remote changes and resolve conflicts for DMLOptions implementation
chininchu Oct 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions dlrs/main/classes/RollupService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1661,8 +1661,21 @@ global with sharing class RollupService {
masterRecords.set(outerIndex, masterRecords.get(indexOfMin));
masterRecords.set(indexOfMin, temp);
}

// Create DmlOptions instance

Database.DmlOptions dmlOptions = new Database.DmlOptions();

// Allows save even if duplicated are detected
dmlOptions.duplicateRuleHeader.allowSave = true;

// Bypass duplicate rules


try {
return Database.update(masterRecords, allOrNothing);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chininchu were you able to test this code in an environment? You've put it back the way it was and aren't including the DmlOptions anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was able to test the code and it works. You should now see the DML options on my latest commit.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these extra lines necessary?


} catch (DMLException e) {
// Determine if the exception is due to parent record/s having been deleted
Boolean throwException = true;
Expand Down
33 changes: 23 additions & 10 deletions dlrs/main/lwc/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
{
"compilerOptions": {
"experimentalDecorators": true
},
"include": ["**/*", "../../../.sfdx/typings/lwc/**/*.d.ts"],
"paths": {
"c/*": ["*"]
},
"typeAcquisition": {
"include": ["jest"]
}
"compilerOptions": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is still showing modified in your PR. Please revert this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be aligned with what's on the main branch.

"experimentalDecorators": true,
"baseUrl": ".",
"paths": {
"c/*": [
"*"
]
}
},
"include": [
"**/*",
"../../../.sfdx/typings/lwc/**/*.d.ts"
],
"paths": {
"c/*": [
"*"
]
},
"typeAcquisition": {
"include": [
"jest"
]
}
}
Loading
Loading