+ Start a Discussion
KMK91KMK91 

In which Scenarios will go for workflow rules and which scenarios will go for triggers tell me one example?

Best Answer chosen by KMK91
JAY_PJAY_P
Hey Madhukar ,
here is the main difference between both of them 


Workflow

1.you cannot create records
2..they currently can only result in a task, email, field update, or outbound message
3..they can only cross objects in a master detail relationship, from the detail to the master, and only for certain scenarios (all custom to custom objects, some custom to standard objects, and even fewer standard to standard) https://help.salesforce.com/HTViewHelpDoc?id=workflow_cross_object_field_updates.htm&language=en_US

Trigger

1.can do these things, but obviously using code
o2.ften needed for roll-up type scenarios where roll up summary fields cannot be used
o3.ften needed when a record needs to be created on a different object
4.needed to kick off some apex code
many other reasons


for example:::::::there is one field salary if u want that salary field value is greater than 50k and you want to if salary > 50k then system did not allow to enter that in this case you have to write down before trigger but in same case u want to send the email to admin but allow to user to put value in salesforce u can write active workflow rule...
Thank YOU