You need to sign in to do that
Don't have an account?
How to pass Owner to a report via a Visualforce page
This relates to a custom object, but could easily be any standard object in Salesforce.
Basically I'm wanting to run a report that shows all records owned by the person logged into Salesforce.
In this instance we have an object called Incidents.
I have a report where I defined the filter as:
<apex:page standardController="Incident__c"> <p> <a href = "/00Oi0000004ZLjh?pv0={!User.Name}" target="_blank">Incidents Assigned to Me</a> </p> </apex:page>
When I try and save the page, I get:
Error: Unknown property 'BMCServiceDesk__Incident__cStandardController.User'
I also tried this:
<apex:page standardController="BMCServiceDesk__Incident__c"> <p> <a href = "/00Oi0000004ZLjh?pv0={$User.Name}" target="_blank">My Incidents</a> </p> </apex:page>
I'm able to save the page; howerver when I click on the URL link to the report, it looks like this and I'm not getting any data returned.
https://na15.salesforce.com/00Oi0000004ZLjh?pv0={$User.Name}
Is there another "session" variable equivilent to Owner Name that I could use in this instance?
Thank you!
Virginia
Instead, you need to use the global variable (which starts with $). The correct answer, then, is that you need both the ! and $: {!$User.FirstName}. Note that Name isn't valid; you would have to use FirstName and LastName.
All Answers
Instead, you need to use the global variable (which starts with $). The correct answer, then, is that you need both the ! and $: {!$User.FirstName}. Note that Name isn't valid; you would have to use FirstName and LastName.
Thank you! I finally arrived at the solution you recommended; but had to wonder if I was missing something.
I appreaciate the help and clarification!
V