You need to sign in to do that
Don't have an account?
Rohit SharmaG
Trigger Event
Hi All,
I have 2 trigger with before event and logic was one for insert and other for update :
Trigger 1:
trigger Test_trigger_event2 on Account (before insert, before update) {
if (trigger.isBefore) {
if (trigger.isInsert) {
//DO SOMETHING
system.debug('This is inser and Update');
}
}
------------------------------------------------------------------------------------------
Trigger 2.
trigger Test_Trigger_event on Account (before update) {
if (trigger.isUpdate) {
//DO SOMETHING
system.debug('@@@@@@@@@@@@ in Update');
}
}
But When i am inserting record trigger 2 was firing , but it should not fired , it will fired only in update operation ,not in insert operation.
Please let me know what changes needed in trigger 2.
Thanks!!
I have 2 trigger with before event and logic was one for insert and other for update :
Trigger 1:
trigger Test_trigger_event2 on Account (before insert, before update) {
if (trigger.isBefore) {
if (trigger.isInsert) {
//DO SOMETHING
system.debug('This is inser and Update');
}
}
------------------------------------------------------------------------------------------
Trigger 2.
trigger Test_Trigger_event on Account (before update) {
if (trigger.isUpdate) {
//DO SOMETHING
system.debug('@@@@@@@@@@@@ in Update');
}
}
But When i am inserting record trigger 2 was firing , but it should not fired , it will fired only in update operation ,not in insert operation.
Please let me know what changes needed in trigger 2.
Thanks!!
SF Admin
This may be because your first trigger is invoking the 2nd trigger.