I need your help to understand what's happening here.
We are using the Customer Portal (Community) for quite a long time, we use 'Customer Community Login User' profiles that we assign to external users in order to grant them access to the community.
I have a controller named OpenProjects.cls that shows the user (based on his account) a list of all the opened Project__c records that belong to the user's account.
Below you can see a query that gets some information about the contact's account.
conAccount = [Select Support_Type__c, BillingCountry, (Select RecordTypeId From Applications__r), (Select Announcement__c From Announcement_Accounts__r) From Account where id =: con.AccountId];
Everything works fine with the above query, but from here it gets messy:
I created a new lookup field on the Contact object that points to an Account (Contact_Account_Integrator__c).
Then, I modified the query (it's the same except for the 'Where' condition) as follow:
conAccount = [Select Support_Type__c, BillingCountry, (Select RecordTypeId From Applications__r), (Select Announcement__c From Announcement_Accounts__r) From Account where id =: con.Contact_Account_Integrator__c];
But now I get this error: 'List has no rows for assignment to SObject'
I tried using the same query on Workbench and it did return results! I checked the Field Level Security and the user's profile has both read and edit permissions Do you have any ideas? does it relate to Sharing Rules?
10:39:36.0 (45554685)|SOQL_EXECUTE_BEGIN||Aggregations:2|SELECT Support_Type__c, BillingCountry, (SELECT RecordTypeId FROM Applications__r), (SELECT Announcement__c FROM Announcement_Accounts__r) FROM Account WHERE id = :tmpVar1 10:39:36.0 (75768637)|SOQL_EXECUTE_END||Rows:0 10:39:36.0 (76084802)|SYSTEM_MODE_EXIT|false 10:39:36.0 (76494931)|FATAL_ERROR|System.QueryException: List has no rows for assignment to SObject