+ Start a Discussion

Help writing a trigger



I have never written an apex trigger and do not know where to start. Can someone guide me through this process or tell me if there is a non-coding method of achieving this?


What I essentially want is to create a record in a custom object based on a criteria met in another object:


I have a custom object named: Maintenance and another object called Support Ticket. I would like a trigger on Maintenance object that says if the status changes to "support needed"  create a new record in Support Ticket object.


Is this possible?


1.You need a SF Developer Account

2.Enable Developer Mode in the Personal information


3.Go through Trigger Documentation available in Documentation area in SF site

4.Understand the concepts

5.After logging in SF developer account SetUp--->Develop-->Triggers--->Write yours logic in the test area and save it(You can also use forceIDE with eclipse)If you are new to the platform start with force.com work book available in the Documentation section area.