based on the link, you posted, the best idea so far seems to be using login.salesforce.com?startURL=Object.id...won't work for sandbox, but it seems better compared to creating a custom object (that's what I had thought of as well).
It just returns a relative URL, not the full URL. I took a standard
controller for Account(my context isn't a VF page), and tried using
getuRl...didn't work...
You can always use the following javascript code to get the URL:
Code:
// getDomain() is called to obtain the domain portion of web app
function getDomain()
{
var url = window.location.toString();
var domain = url.match( /:\/\/(www\.)—([^\/]+)/ );
domain = domain[2]?domain[2]:'';
return domain;
}
My code is in a trigger that is fired due to a workflow rule being executed. I am trying to send e-mail reminders to people on their tasks (with a URL link to task)...
Did you ever figure this one out? I'm trying to do something very similar to what you are doing, i.e., programmatically create a task and email notification which contains the full URL to the task, using Apex. Just wondering if you ever came up with a satisfactory solution on this before I go and try to re-invent the wheel. TIA.
Hmm... I tried that. I kept getting a "URL No Longer Exists" error. That's ok. I worked around it by saving the Salesforce hostname as a field on a custom object type that I use to store other application settings. That approach is good enough for my purposes. Thanks.
This works in Apex, but how would I get the server URL in a standard e-mail template? Frequently you want to to send a link to the user to an record in an e-mail template.
Please refer this link... I hope this would be helpful to you.....
http://community.salesforce.com/t5/Apex-Code-Development/how-to-retrieve-server-URL-in-APEX-class-or-in-trigger/td-p/95659
All Answers
This is the format:
https://YOUR INSTANCE.salesforce.com/YOUR OBJECT ID
example:
https://cs2.salesforce.com/00120000000WNVDAA4
In each there are some functions that you may be able to use.
based on the link, you posted, the best idea so far seems to be using login.salesforce.com?startURL=Object.id...won't work for sandbox, but it seems better compared to creating a custom object (that's what I had thought of as well).
Sam.arj.
I tried that before. http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=1099
It just returns a relative URL, not the full URL. I took a standard controller for Account(my context isn't a VF page), and tried using getuRl...didn't work...
Message Edited by Sam.arj on 07-29-2008 10:18 AM
Sounds like a good idea...won't work for me...
My code is in a trigger that is fired due to a workflow rule being executed. I am trying to send e-mail reminders to people on their tasks (with a URL link to task)...
See http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=5896
Hi GoForceGo,
Did you ever figure this one out? I'm trying to do something very similar to what you are doing, i.e., programmatically create a task and email notification which contains the full URL to the task, using Apex. Just wondering if you ever came up with a satisfactory solution on this before I go and try to re-invent the wheel. TIA.
login.salesforce.com/?startURL=Object.id
This won't work for Sandbox, but will do the job for production.
A custom "configuration" object is obviously a good idea!
Please refer this link... I hope this would be helpful to you.....
http://community.salesforce.com/t5/Apex-Code-Development/how-to-retrieve-server-URL-in-APEX-class-or-in-trigger/td-p/95659
Cool and thanks! Hidden stuff
A standard page's header has "Host" in it's map!
This works in Apex, but how would I get the server URL in a standard e-mail template? Frequently you want to to send a link to the user to an record in an e-mail template.