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
Durgamba RayuduDurgamba Rayudu 

Logged in users name

Hi,
I need to create a view to filter data with condition primary contact on opportunity is equal to Logged in user. is it possible to do without creatign formula filed?

 
Andrew GAndrew G
Short answer - no.

For example, you cannot use the $User.LastName or similar features in your list view filters.

Only way I can think to do it (simply) is to use the formula field , something like 
 
IF(  
  AND(
    FirstName = $User.FirstName,
    LastName  = $User.LastName
  ),
  "Yes", 
  "No"
)

Then set a filter in the list view where the field equals "Yes"

You could try playing with visualforce pages and setting the controller in the back end to query based on Current User and filtering against name fields, but it seems a lot of excess work when you could use just the formula field.

Regards

Andrew