You need to sign in to do that
Don't have an account?
Justin Mitchell
How can I link to a user or a queue depending on which is the owner?
This is probably very simple but I'm having trouble figuring out the syntax. I am trying to display a link to the record owner's record on a visualforce page. If it's a user, the link should be
I have tried to add this conditionally into the outputLink but I either get a syntax error one way, or I get a bad url.
Here's one thing I've tried:
'/{!ws.Owner.id}'If it's a queue I believe it should be
'/p/own/Queue/d?id={!ws.Owner.id}'
I have tried to add this conditionally into the outputLink but I either get a syntax error one way, or I get a bad url.
Here's one thing I've tried:
<apex:outputLink value="{!IF( ws.Owner.Type = 'User', '/{!ws.Owner.id}', '/p/own/Queue/d?id={!ws.Owner.id}')}" target="_blank"> {!ws.Owner.Name} </apex:outputlink>
The resulting urls generated from the code above is
"https://cs45.salesforce.com/#{ws.Owner.id}"
and
"https://cs45.salesforce.com/p/own/Queue/d?id=%7B!ws.Owner.id%7D"
respectively.
Question 1: Is there a simpler way to link to the Owner's record than using conditional output (ie: <apex:outputLink value="/{!ws.Owner.IdNoMatterIfTheyAreAUserOrAQueue}"> )?
Question 2: If not, what is the proper syntax to use when trying to insert variables (might not be the correct terminology) into a condtional statement?
Thanks!
IF( ws.Owner.Type == 'User',
The part I can't figure out is how to get the resulting link to come out as "salesforce.com/906F0000000MMcK" instead of "salesforce.com//{!ws.Owner.id}"
This puts two hyperlinks into the same cell of the table, but only shows one of them depending on whether the owner is a User or a Queue.