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

Need urgent help to get the url in trigger

Can anybody help me how to get url in trigger


The trigger is after insert and when I tried with ApexPages.currentPage() it is giving null


Triggers don't have the concept of a URL - they are detached from the page that the user is on.


Can you explain a little about what you are trying to achieve here?


Actually I want to get a value of the hidden field while cloning.. And as part of standard funtionality hidden fields wont be cloned is what I came to know. So I am sending that value as a Url and want to get that value after inserting the cloned record.


As you are in a trigger, you are running in the system context.  This means that field level security for the current user isn't taken into account.  Do you have a way to determine the original record?  If so you can simply retrieve it and copy the hidden fields.