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
SathyaincampusSathyaincampus 

current user filter in the view list?

 i need a current user filter in the view list that is being displayed in the top of every tab in SF.. for ex :- i have a recruiting app.. and each recruiter has their own login.. if they login to the system they should be able to see the positions only they are assigned to.. the information of which will be stored in the Recruiter field (not Owner) under position record. they are requesting that if they choose a view they should be able to see only that.. as per my understanding...there is no option like that in SF.. any ideas? similar to my positions which will be useful only for owner fields...

Best Answer chosen by Admin (Salesforce Developers) 
flewellsflewells

I'm not 100% clear on your question, but it is a formula field, so it's not a static value.  It will change depending on the User specified on the Recruiter record and the User logged into Salesforce.com.  For example, if my name is in the Recruiter field and I'm logged into the system, the field will show "yes" to me.  If my name is in the Recruiter field and you're logged into the system, the field will show "no" to you.

 

I should have clarified this earlier...this is not a field I would expect to see on the page layout.  It's best suited for reports and list views and enables the creation of one report or one list view that an entire team of Recruiters can use and only have to see "their" records.

 

Does that help clarify?

All Answers

flewellsflewells

It sounds like your Recruiter field is a lookup to User.  If that's the case, you can create a custom formula field (formula return type = text) on that object -- something like "Am I the recruiter?".  The formula will evaluate if the User ID of the name in the Recruiter field is the same as the person who is logged in.  Assuming there is always a name in the recruiter field, it will look like this:

 

IF( Recruiter__r.Id = $User.Id, "Yes", "No")

 

Now that you have this field, you can create a list view with filter criteria Am I the recruiter? <equals> yes.  The list view can be used by any Recruiter and should show each recruiter's respective records.

 

SathyaincampusSathyaincampus

hi flewells,

 

   thanks for your reply. yes it is a lookup field. but does it mean that a formula field will not populate the data on the table while saving the record and rather it would show up the values dynamically in the formula field based on every user action is it??

 

regards

sathya

flewellsflewells

I'm not 100% clear on your question, but it is a formula field, so it's not a static value.  It will change depending on the User specified on the Recruiter record and the User logged into Salesforce.com.  For example, if my name is in the Recruiter field and I'm logged into the system, the field will show "yes" to me.  If my name is in the Recruiter field and you're logged into the system, the field will show "no" to you.

 

I should have clarified this earlier...this is not a field I would expect to see on the page layout.  It's best suited for reports and list views and enables the creation of one report or one list view that an entire team of Recruiters can use and only have to see "their" records.

 

Does that help clarify?

This was selected as the best answer
SathyaincampusSathyaincampus

oh thats really great then.. thank you so much...

will check that out and will get back to you..

 

regards

sathya

SathyaincampusSathyaincampus

hi flewells,

 

  I have a quick question on some other topic too.. if possible can you answer that one too.. here is the link..

http://boards.developerforce.com/t5/General-Development/framing-the-soql-from-the-listview-columns-based-on-metadata/td-p/237717

 

and i asked the same question here too :

https://sites.secure.force.com/success/questionDetail

 

regards

sathya

 

flewellsflewells

hi sathya, sorry, not able to help you with your SOQL question...

SathyaincampusSathyaincampus

ok flewells..

thanks anyways...

SripriyaSripriya

Good one It Worked out !!!

Thanks Guys

Sushma  RamakrishnanSushma Ramakrishnan
@flewells : Thanks so much for your idea.It worked out for my requirement as well...!!!
Sasidhar Reddy 43Sasidhar Reddy 43
@flewells : Thank you for the idea, It helped me too(Keep posting your idea's