I'm going to add a little more detail here.
There's a total of four kinds of note and attachment object you might be seeing on your objects, and they're queried in different ways.
Classic Attachments
SELECT Id FROM Attachment WHERE ParentId = 'SOME_ID'
or
SELECT Id FROM Attachment WHERE Parent.Type = 'SOME_SOBJECT_TYPE'
will get you data on your old-style Attachments.
Classic Notes
These work just like Attachments, but with a different sObject:
SELECT Id FROM Note WHERE ParentId = 'SOME_ID'
or
SELECT Id FROM Note WHERE Parent.Type = 'SOME_SOBJECT_TYPE'
Content Notes and Content Documents
Content Notes are the new-style "Enhanced Notes". They're built on the Content architecture under the hood, and have rich-text bodies.
Content Documents (with associated Content Versions) represent the new Lightning Files.
Unfortunately, both are related to records using the ContentDocumentLink
object, rather than having a direct lookup, and this comes with some significant query limitations:
You can't run a query without filters against ContentDocumentLink.
You can't filter on ContentDocument fields if you're filtering by ContentDocumentId. You can only filter on ContentDocument fields if you're filtering by LinkedEntityId.
You can't filter on the related object fields. For example, you can't filter on the properties of the account to which a file is linked. You can filter on the properties of the file, such as the title field.
A SOQL query must filter on one of Id, ContentDocumentId, or LinkedEntityId.
So, to be short, you can't query all ContentNote
or ContentDocument
records attached to some specific type of object easily.
You'd have to do something like exporting all Ids for a given sObject type and iteratively querying sets of those Ids against the ContentDocumentLink
table to locate attached files. This is something I've done before (and written about here), but it takes some Python or another scripting language to get it done.
If you do have a specific Id or Ids of records whose attachments you want to find, you can do it like this:
SELECT ContentDocumentId, ContentDocument.Title FROM ContentDocumentLink WHERE LinkedEntityId = 'OBJECT_ID'
Note that Content Notes are returned in a Content Document query - they are just a special type of Document.
Salesforce provides you with an option:-
Use duplicate record reports to fine-tune your duplicate and matching
rules and share the results of duplicate jobs.
A duplicate records report can include these records.
- Duplicates created when a rule alerts a user to a possible duplicate,
but the user creates the duplicate anyway (to generate this report,
select the Report option in a duplicate rule)
- Records manually added to a duplicate record set
- Records in duplicate record sets generated by duplicate jobs
In Setup, use the Quick Find box to find Report Types.
- Create a report type, selecting Account, Contact, Lead, or Duplicate
Record Set as the primary object.
- If you use person accounts, distinguish them from business accounts
by adding the Is Person Account field in the field layout properties for your report type.
- If you’re working toward complying with various data protection and
privacy regulations, consider excluding personal data from the report name and description.
- Click Next.
- Relate Duplicate Record Items to the primary object that you
selected. Save the report type.
- Give your users access to the Duplicate Record Set and Duplicate
Record Items objects. Then they can create reports based on the
custom record type you’ve created.
Reference:- Create Reports on Duplicate Records
There is another option I found while analysing your question:-
create a custom Formula(Text) field that concatenates the fields you
want to use in your duplicate criteria.
FirstName + LastName + Email, etc.
Then create a custom Formula(Number,0) field and enter 1 as the
default value.
Then create a summary report grouped by your custom Text field and
Summarize your custom number field, and use conditional highlighting
to highlight any group with a count > 1
Reference:- How to create a Report for finding Duplicate Contacts in my instance?
Best Answer
As you mentioned in the Question, I guess workbench operated in the Bulk API but in Parallel Processing mode. Parallel Processing mode is known to throw these kind of errors. Refer to the section
Managing Locks to Maximize the Benefits of Parallelism
in this The Salesforce Bulk API - Maximizing Parallelism and Throughput Performance When Integrating or Loading Large Data VolumesAlso, in Dataloader
BULK API
is not enabled by default. We have to go to settings and check the checkbox. Because you did not, I guess it operated in the SOAP/REST API mode.You can even go to your org and check
BULK Data load jobs
section to make sure those 50000 rows did not use BULK API.