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

Conversation

chininchu
Copy link
Contributor

Critical Changes

  • None

Changes

  • Implemented DMLOptions to allow DLRS updates on duplicate Leads and Accounts
  • Modified DLRS update logic to bypass duplicate rule exceptions
  • Updated rollup calculation process to correctly handle duplicate records

Issues Closed

@chininchu
Copy link
Contributor Author

@aheber
Ready for review

@aheber
Copy link
Contributor

aheber commented Oct 2, 2024

@chininchu thanks for getting this in! It looks like you've discarded the "allOrNothing" flag. You should be able to add it to the DMLOptions instance and retest.

Could you revert the changes to the other files? Feel free to submit them separately. The change to update Prettier version would be a great additional PR.


// Bypass duplicate rules

// dmlOptions.duplicateRuleHeader.duplicateRuleBypassFlow = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you remove this extra comment?

Copy link
Contributor

@aheber aheber left a comment

Choose a reason for hiding this comment

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

I think this might have slid backwards as well as missed a few points from our discussions. Let me know when it is updated and I can take another look at it.


// 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.

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.

Are these extra lines necessary?

"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.

@@ -25,8 +25,8 @@
"eslint-plugin-jest": "^24.7.0",
"husky": "^6.0.0",
"lint-staged": "^11.2.6",
"prettier": "^2.5.0",
"prettier-plugin-apex": "^1.10.0"
"prettier": "2.5.0",
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.

@chininchu
Copy link
Contributor Author

@chininchu thanks for getting this in! It looks like you've discarded the "allOrNothing" flag. You should be able to add it to the DMLOptions instance and retest.

Could you revert the changes to the other files? Feel free to submit them separately. The change to update Prettier version would be a great additional PR.

@aheber, Please refer to my latest commit for changes. Thanks.

@chininchu chininchu requested a review from a team as a code owner October 5, 2024 17:39
@aheber
Copy link
Contributor

aheber commented Oct 8, 2024

Superseded by #1502

@aheber aheber closed this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants