+ Start a Discussion

No such column 'SobjectType' on entity 'DuplicateRecordSet'.

No such column 'SobjectType' on entity 'DuplicateRecordSet'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
String query =[Select id,DuplicateRecordSetId,Name,RecordId from DuplicateRecordItem Where DuplicateRecordSet.SobjectType='Contact'];
return Database.getQueryLocator(query);
NagendraNagendra (Salesforce Developers) 
Hi Rov,

Sorry for this issue you are encountering.

From the above code, it seems like there is no such field which you are trying to query. In the SOQL query you are fetching DuplicateRecordSetId
field and in the where condition you are checking DuplicateRecordSet.SobjectType='Contact']. If you think DuplicateRecordSetId is the correct field you are fetching then update the same in the where condition as below.
String query =[Select id,DuplicateRecordSetId,Name,RecordId from DuplicateRecordItem Where DuplicateRecordSetId.SobjectType='Contact'];         
return Database.getQueryLocator(query);
Please let us know if this helps.

Kindly mark this as solved if the reply was helpful.


Raj VakatiRaj Vakati
I am also facing the same issue .. looks like the Field DuplicateRecordSet.SobjectType is not showing on object when i open from the developer console .. use Record Id FIeld now 

Thanks @RajVakati and @Nagendra 

I ran the following in Dev Console and also workbench and found the only fields available to use are the ones in my query. 

So basically we can't use SobjectType, ParentId from DuplicateRecordSet
and RecordId from DuplicateRecordItem
list<DuplicateRecordItem> query =[Select id,DuplicateRecordSetId,Name,RecordId from DuplicateRecordItem];         

list<DuplicateRecordSet> query = [Select DuplicateRuleId, Name, RecordCount FROM DuplicateRecordSet];