function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BradCBradC 

Case view formula "currently signed in user" variable?

We are currently considering allowing our customers to access the SFDC case portal. Right now we are looking into different types of case views that we can setup to show the customer's cases.

 

We hit a roadblock in terms of allowing customers (who can see everyones cases that are from the same company) to only see their own cases in certain fields.

 

For example, John is apart of Acme Inc. and along with 4 coworkers, they have 5000 cases. John himself has 300 cases.

 

I want to create a view, so john can go to "My Open Cases" and it will only show john his open cases (<=300) rather than everyone's cases. While I know can set the scope to"my cases" if you have an employee account, is there a way to allow john or any of his cowokers to only see their own cases in some views, but all of their cases in other views? I have been looking for a variable such as CURRENT_USER() or LOGGED_IN_USER() that could be used in the case view critiera but haven't been able to find anything so far.

 

Any assistance would be greatly appreciated.

 

Thanks!

 

Brad 

Best Answer chosen by Admin (Salesforce Developers) 
kcpluspluskcplusplus

I think that if you use a great technique from stevemo you can do this. Basically you want to create a formula field, that returns a 1 if the running user is the created user, 0 otherwise. You can then use that as filter criteria, so running_user__c equals 1, in your report of list view.

 

Take a look at this answer by steve, he really explains it best: http://success.salesforce.com/questionDetail?qid=a1X30000000IPjtEAG

 

--KC

All Answers

kcpluspluskcplusplus

I think that if you use a great technique from stevemo you can do this. Basically you want to create a formula field, that returns a 1 if the running user is the created user, 0 otherwise. You can then use that as filter criteria, so running_user__c equals 1, in your report of list view.

 

Take a look at this answer by steve, he really explains it best: http://success.salesforce.com/questionDetail?qid=a1X30000000IPjtEAG

 

--KC

This was selected as the best answer
BradCBradC

Thank you so much! After some editing, I was able to get it to work right. The reason that we couldn't use the "My Cases" option out of the box is the case owner is usually not the user that filed the case. The way we have our system setup, the case contact is the user that created the case, where as the case owner is the customer support rep that is managing the case.

 

Here is the code I used and it works perfectly:

 

IF(!ISBLANK(ContactId), IF($User.ContactId == ContactId, "TRUE", "FALSE"), "FALSE")

 

If it's true, then the case portal user is also the case contact. Thanks again for your help! Much appreciated!!