+ Start a Discussion
SURESH COOLSURESH COOL 

TRIGGER

CAN WE WRITE THE CONTROLER IN TRIGGER? CAN WE WRITE TRIGGER IN CONTROLE R?....WHICH IS POSSIBLE CAN ANY ONE EXPLAIN PLZ
bob_buzzardbob_buzzard

No you can't do either of those.  A trigger is automatically executed when a change is made to a record in the database, while a controller is instantiated on demand when a user accesses a Visualforce page.

Ashish_SFDCAshish_SFDC

Hi Suresh, 

 

Trigger is a logic that fires on a Database Event where as Controller is behind the logic about a Visualforce page. 

So trigger cannot be included in the Display (Controller) logic and Controller(Display) cannot fire a logic to be executed.

 

Regards,

Ashish

sandeep@Salesforcesandeep@Salesforce

You can wrtie class in trigger. it is possible now earlier it was not possible. it is just like inner class.