Ask Search:
Kenny BarryKenny Barry 

My Department's Opportunities List View

I am attempting to create a custom List View that displays the current user's department's opportunities.  To do so, I created the following UserDepartment__c custom number formula field on the Opportunity object: 

IF(Owner.Department=$User.Department,1,0)

Then I created a 'My Department's Opportunities' List View that is All Opportunities filtered by UserDepartment__c = 1.  Unfortunately, all records are showing, not just those of the user's departments.  The Department field is accurately populated for all User records.

Any idea what might be causing this filter to not work as expected?  I have similar "My Records" list views on custom objects using an IF($User.Id=Owner.Id,1,0) formula field and they work as expected.  Thanks!
Best Answer chosen by Kenny Barry
Sunil SarillaSunil Sarilla
Hi Kenny,
your formula looks fine and since you mentioned the user's departments are accurately populated, please double check the same, also double check if you have applied the right filter on the list view(s) .

I would do the below, just to confirm the formula number field is right
create 2 formula fields of return type text
Owner Department
Current User Department

formula will be as below
Owner.Department
 
$User.Deaprtment
include those fields in the My Department's List view and see if you can pin point if something is wrong

 

All Answers

Sunil SarillaSunil Sarilla
Hi Kenny,
your formula looks fine and since you mentioned the user's departments are accurately populated, please double check the same, also double check if you have applied the right filter on the list view(s) .

I would do the below, just to confirm the formula number field is right
create 2 formula fields of return type text
Owner Department
Current User Department

formula will be as below
Owner.Department
 
$User.Deaprtment
include those fields in the My Department's List view and see if you can pin point if something is wrong

 
This was selected as the best answer
Kenny BarryKenny Barry
Thanks for that feedback, Sunil.  That helped me narrow down what could have been causing the issue. 

I ended up needing to open up field-level security for that formula field.  The user I was testing did not have read access to the formula so it was not showing in their list view.