This will be the first of many lessons on Triggers. But before I start writing triggers in salesforce.com, I need to explain triggers and how they work. One needs to understand before anything. So lets start.
- What is a Trigger?
- What does the above definition mean in simple English. Basically a trigger is an event that fires off when a record is changed.
- by changed I mean, you can:
- Update a Record - Updating an existing record.
- Insert Record - Inserting a new record like a new Account or Contact.
- Delete Record - before the record deletes make sure everything is valid.
- These three Actions we call (Update, Insert, Delete) are the main functions of a trigger. Basically which one will use a trigger for.
- Also one can use a trigger as a controller combine with Visualforce or calling a web service API.
- People have asked the question "How can I override the Save button in Force.com" Plain and simple way is to write a trigger. Why or How?
- Simple, when you create or update a record the only way your new information weather you added information to an existing record or changed it or you added a new record, one would have to click SAVE to place the information into the database.
- By clicking Save if you have a trigger on that Object then you can fire it off, thus overriding the save button. It will save and do the commands you wrote in the trigger itself.
- Also, triggers must be written in Sandbox and then deploy to server via eclipse tool.
- It must pass the standard requirement of 75% in sandbox before deploying into production.
I hope this cleared many questions about understanding a trigger. My next post will be on writing a trigger and implementing it.
Thanks
View my Other Blogs:
VisualForce Made Easy
Salesforce Data Migration Made Easy
No comments:
Post a Comment