According to the code below, i can display the open cases in dashboard belonging only to Babara Levy, but i need the cases to be displayed according to the user when he/she logs into sfdc, for example if i login then i should see my cases in dashboard, and if other users logs into sfdc then they should be able to see their own cases in dashboard, can anyone plz help me with what are the changes to be done in class,iam need to sfdc.
public class retrieveCase { public String getContactName() { return 'Babara Levy'; } public List<Case> getCases() { return [SELECT status, subject FROM Case WHERE Contact.name = 'Babara Levy' AND status != 'Closed' limit 5]; } }
You need change here
return [SELECT status, subject FROM Case
WHERE Contact.name = 'Babara Levy' AND status != 'Closed' and ownerid=:userinfo.getUserId()];
Try this..