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
Alex Calder 10Alex Calder 10 

Trigger started from certain page

Is there a way to tell a trigger that it was started from a certain page?  For example, if a new opportunity is created from the Contact page then do something, if created from Account page do something, if created from a custom object then do something, so on and so forth.
Best Answer chosen by Alex Calder 10
Steven NsubugaSteven Nsubuga
You would have to set this up yourself by adding a custom field to your opportunity, maybe a picklist with options on origin, whether Contact Page, Account Page, Dataloader, Opportunity tab etc, and hope that the user enters a value for the field. 
It is not a feature that is available out of the box.

All Answers

Steven NsubugaSteven Nsubuga
You would have to set this up yourself by adding a custom field to your opportunity, maybe a picklist with options on origin, whether Contact Page, Account Page, Dataloader, Opportunity tab etc, and hope that the user enters a value for the field. 
It is not a feature that is available out of the box.
This was selected as the best answer
Alex Calder 10Alex Calder 10
Thank sir
Steven NsubugaSteven Nsubuga
My pleasure Alex.