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
advlgxpmadvlgxpm 

Create Report With Created By with current user as filter

Is it possible to set your report criteria to the Created By field = XXX where XXX is the current user? What is the syntax for the value field for that?
Best Answer chosen by Admin (Salesforce Developers) 
gpedronigpedroni

Any progress on this? I am hunting a way to find CURRENT USER in any one of 3 user lookup fields for a report. So if a user is linked to a record in any  one of 3 fields (team leader, team member 1, 2 3) they will show up on a view called My  Assigned Projects.

 

So CURRENT USER would be ideal.... 

 

--------------------

ok the above worked with my scenario as follows:

 

New number formula field with this code:

IF( 
     OR( 
              $User.Id = Engineer_Lead__c, 
              $User.Id = Team_Member_1__c, 
              $User.Id = Team_Member_2__c, 
              $User.Id = Team_Member_3__c 
              ),1, 0)

 

then in the view I used filter as follows:

 

Assigned = 1 (so whoever logged in, it will kick back 1 and show them their assigned projects.

All Answers

RickyGRickyG
It kind of sounds like you want to report on the "My records" option.  Would that work?

Hope this helps.
advlgxpmadvlgxpm
No because the records I'm reporting on participate in a master detail relationship as the detail, so the owner is on the master record, and the user reporting does not own the parent record.
tttt
But isn't the report type you are using based on the master in the master-detail?
So if you have
invoice as the master and "line-item" as the detail,  isn't the report type you've chose "invoices and line items"
and then you can make the choice "my invoices".
 
Isn't that what you want?
advlgxpmadvlgxpm

No, I created a report type just for this object. The owner of the master is not necessarily and usually isn't the person creating the child record.

It's essentially a project system. The master is the project record, owned by the project manager, the child is the todo record, identified by the user requesting the todo, thereby the need to filter a custom lookup to the User object by the current user.

In any event, is there not any filter special criteria, like we have for date for the User object fields? Like NEXT WEEK, NEXT n DAYS, etc.... except for User lookup fields, like CURRENT USER

JeremyKraybillJeremyKraybill
Hi there, I am looking into this exact same issue. We have a parent record which is not necessarily owned by the person who creates some of the detail records. We gave the detail-level record its own tab and views. I want, hopefully via the standard view screen, to be able to have a "My Records" view on the detail records which only shows detail records created by me.

Were you able to find any solution for this?

Jeremy Kraybill
Austin, TX
JeremyKraybillJeremyKraybill
I'm not sure if there is a more elegant solution, but the one I decided to use for this is to create a custom formula field on the child object called "CreatedByMe" (hidden on all page layouts) whose formula is

Code:
if( CreatedById = $User.Id , 1, 0)

And then use that field for reporting and views. Not perfect but it works and allows you the full power of formulas in your filter criteria.

Jeremy Kraybill
Austin, TX
gpedronigpedroni

Any progress on this? I am hunting a way to find CURRENT USER in any one of 3 user lookup fields for a report. So if a user is linked to a record in any  one of 3 fields (team leader, team member 1, 2 3) they will show up on a view called My  Assigned Projects.

 

So CURRENT USER would be ideal.... 

 

--------------------

ok the above worked with my scenario as follows:

 

New number formula field with this code:

IF( 
     OR( 
              $User.Id = Engineer_Lead__c, 
              $User.Id = Team_Member_1__c, 
              $User.Id = Team_Member_2__c, 
              $User.Id = Team_Member_3__c 
              ),1, 0)

 

then in the view I used filter as follows:

 

Assigned = 1 (so whoever logged in, it will kick back 1 and show them their assigned projects.

This was selected as the best answer