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
ccracyccracy 

Is there a way to refer to the Server URL inside an Apex Trigger?

I have writen a duplicate check trigger, before insert, that basically iterates over all Contacts to see if a duplicate exists. In case a duplicate is found, i need to set the error message with the link to this contact.

I have the Contact Id, i need to know the server url for creating the link in the triger. Is is possible to get the server URL inside the trigger?

Thanks,
Rohit M.

mtbclimbermtbclimber
No you can not get the server URL in apex today.

If your link appears in the UI then you can use a relative url.

Message Edited by mtbclimber on 09-20-2007 07:41 AM

GoForceGoGoForceGo
Any way of getting server URL now?

Apex PageReference Object returns a URL - but is only a relative URL! I was hoping i could use a standard object pagereference and get the URL from there!


GoForceGoGoForceGo
Andrew,

Anyway of doing this now?

As I said, pagereference.geturl just gets me the relative URL!



GoForceGoGoForceGo
Anyone out there?

Is there a way of getting Server URL in Apex....