Timeline for Merging duplicate accounts in Apex - Governor limits
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 18, 2016 at 12:36 | comment | added | Adrian Larson♦ | @Bob separate question. | |
Oct 18, 2016 at 5:30 | comment | added | user27749 | @AdrianLarson My other question is I am also writing an after insert trigger which calls an asynchronous method but that would also have a DML issue once the number of DML operation crosses 150. Is there any way to mitigate it ? | |
Oct 18, 2016 at 5:28 | comment | added | user27749 | @AdrianLarson I was able to do it by moving my initial query to start method and Limits.getLimitDmlStatements() but was not able to use aggregate result as NewUniqID which is column which has duplicate values is a formula field. Thanks again as I was dumb not use the start method in the first instance. | |
Oct 18, 2016 at 3:45 | vote | accept | user27749 | ||
Oct 18, 2016 at 3:33 | comment | added | user27749 | Yes, I get your point regarding the start method.I will try it. Thanks heaps @AdrianLarson. | |
Oct 18, 2016 at 3:30 | comment | added | Adrian Larson♦ |
Okay, however the de-duplication method works, you have to query the Account records (or possibly an aggregate) in your start method. Standard de-duplication is easier because it is clear you can use aggregates and ensure all duplicates are within the same batch.
|
|
Oct 18, 2016 at 3:28 | comment | added | user27749 | @AdrianLarson thanks for the responses. From the looks of it, it doesn't look like its de duplication but infact it is. To give a bit of context - we have a legacy system which sends us the account details which are inserted using Jitterbit. They have decided to modify the unique id ( which was based on each location before) to a new format, which would be 1 followed by the last digits. So after the cut off date the same account would come with a new format id and then only way was to merge them based on the criteria. NewUniqID is a formula created by us to check . | |
Oct 18, 2016 at 3:28 | answer | added | Adrian Larson♦ | timeline score: 2 | |
Oct 18, 2016 at 3:21 | comment | added | sfdcfox♦ | @AdrianLarson Ah. Right. That's not the purpose of the start method... | |
Oct 18, 2016 at 3:19 | comment | added | Adrian Larson♦ |
That doesn't really look like de-duplication...you never check if the two values are equal. Don't you just want to merge records that have the same UniqueId__c ?
|
|
Oct 18, 2016 at 3:14 | comment | added | user27749 | OK, I must be missing something then as I have written a batch. I have edited the question to include my code. Please check it now. | |
Oct 18, 2016 at 3:13 | history | edited | Adrian Larson♦ | CC BY-SA 3.0 |
added 220 characters in body
|
Oct 18, 2016 at 3:12 | history | edited | user27749 | CC BY-SA 3.0 |
added 1934 characters in body
|
Oct 18, 2016 at 3:04 | comment | added | Adrian Larson♦ | So...can you share what you have tried? It should be no problem in a batch where you can control the batch size. | |
Oct 18, 2016 at 3:04 | history | edited | Adrian Larson♦ |
edited tags
|
|
Oct 18, 2016 at 2:48 | history | asked | user27749 | CC BY-SA 3.0 |