We are using angular to display UI and Salesforce is being used to maintain database. We have a REST API class created which has the url Mapping. This class is used to find the records.

We are using 'Customer Community Login' Custom profile and need to check the data by logging as Community User.

We have a lookup field in a custom object (Customer__c). This object and the lookup field(Book__c) are being queried in angular. The required lookup field needs to have 'Read' access on the Custom profile. However, this lookup field is not running on front-end. We checked all the possible IDs and fields access, permission sets, triggers but none seems to be blocking it from getting it accessible from font-end. The OWD for the related object (Book__c, being used in lookup field) is 'Private' and we cannot change it to Public Read/Write. If we provide 'View All' permission to the related object (being used in Lookup field),the query does return with the successful response on front-end.

What could be the cause for failure of query without the 'View All' permission?

Please suggest.

  • 1
    Sharing rules on the object. Is it a private or public object? If it is private, for your tests you'll need to access a record in which the test user has access. Apr 15, 2017 at 20:00
  • @RenatoOliveira thanks for the suggestion... Sharing rules are present for this object but none of them seems to be related to the cause. Will be checking the test class. Apr 15, 2017 at 20:36
  • No, all seems to be ok. But no changes in null response. Apr 15, 2017 at 20:45
  • The user needs read access to the object, read access to the field, and read access to record(s) to return anything. Just read access to lookup field will not return data.
    – gorav
    Apr 16, 2017 at 19:20
  • @gorav Thanks for the info. I checked all the read access as mentioned above. I ran this query SELECT RecordId, HasReadAccess FROM UserRecordAccess WHERE UserId = [single ID] AND RecordId = [single ID], and it returned 'true' for access permissions. Still no luck in working without 'View All' permission. Apr 17, 2017 at 5:41


You must log in to answer this question.

Browse other questions tagged .