You need to sign in to do that
Don't have an account?
Having trouble getting ALL the cases of an account
I am trying to make a custom page in my Customer Portal that shows ALL the cases of an account instead of just that specific user's. I received some help from another user on this board and he recommended I do this in my custom controller:
Id accountId = [SELECT Contact.AccountId FROM User WHERE Id = :UserInfo.getUserId()].Contact.AccountId;
List<Case> results = [SELECT Id, CaseNumber FROM Case WHERE AccountId = :accountId];
However, this does not return ALL the cases for the user's account. This still only returns the cases that the user himself opened. I am looking to get a list of cases that other users that are part of the account have opened as well. What am I missing here? Thanks!
In your controller class have you used "With sharing"? If yes remove or make it to without sharing and see if it helps.
All Answers
In your controller class have you used "With sharing"? If yes remove or make it to without sharing and see if it helps.
This worked, thanks!