You need to sign in to do that
Don't have an account?
nagarjuna guraja
Need Trigger Development and trigger related question reply
Hello,
I need a trigger and simple question on trigger
1.Write a trigger on lead object, whenever leadSource is 'Direct',update LeadStatus should be equal to 'Hot'.
2. Can we perform dml operation on same object in trigger'
Best Regards,
I need a trigger and simple question on trigger
1.Write a trigger on lead object, whenever leadSource is 'Direct',update LeadStatus should be equal to 'Hot'.
2. Can we perform dml operation on same object in trigger'
Best Regards,
try with below code
If this helps, Please mark it as best answer.
Thanks!!
Before triggers are used to perform the logic on the same object and it triggers fired before the data saved into the database. For DML operation it required to commit with data base. So, we cannot use the DML operation on these triggers.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Instead of triiger you can use WorkFlow or Process buider, for your solution
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
please find answers to your query below.
1. 2. You cannot perform DML operation In trigger, the reason it is not possible is
- In Before trigger If you update any value in the record salesforce automatically update the value for you, DML Statements are not required in code
- In after trigger, the record in which the update is happing is locked so you are not allowed to perform any DML here.
Kindly mark my solution as the best answer if it helps you.Thanks
Prateek