In Winter 18, SOQL query on RecordType returns partial results
Last updated 2020-07-07 ·Reference W-4360455 ·Reported By 11 users
Record Types which are inaccessible to the user, gets filtered out but that is still counted as part of results.
Count and actual returned results count from SOQL query on RecordType is incorrect.
1. Login as Admin User in Winter 18 Org
2. Create a Custom Object and Add a RecordType say RecordType1
3. Create another User say User1 who does not have access to the Custom Object created in step2
4. Now running SOQL query SELECT count(Id) FROM RecordType will rerun the result as 1 (may be more than 1 if any standard objects have record types)
5. Running the SOQL query will return SELECT Id, Name, IsActive, SobjectType, DeveloperName, Description FROM RecordType will return Sorry, no records returned. (or less that what was returned in above query)
The results of SOQL query from step 4 and step 5 does not match
The results of SOQL query from step 4 and step 5 should match
This affects Limit statements as well.
If there are a number, say 2 RecordTypes that user doesn't have access to, these queries will return no rows:
SELECT Id, Name from RecordType limit 1
SELECT Id, Name from RecordType limit 2
From limit 3, it will returns some of the rows (although the total number is not exact)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.