You need to sign in to do that
Don't have an account?
ifthikar Ahmed 1
Additionally, if you update or delete a record in its before trigger, or delete a record in its after trigger, you will receive a runtime error. This includes both direct and indirect operations. For example, if you update account A, and the before update trigger of account A inserts contact B, and the after insert trigger of contact B queries for account A and updates it using the DML update statement or database method, then you are indirectly updating account A in its before trigger, and you will receive a runtime error.
can some one help me understan with an example pls
clarification on Triggers
Additionally, if you update or delete a record in its before trigger, or delete a record in its after trigger, you will receive a runtime error. This includes both direct and indirect operations. For example, if you update account A, and the before update trigger of account A inserts contact B, and the after insert trigger of contact B queries for account A and updates it using the DML update statement or database method, then you are indirectly updating account A in its before trigger, and you will receive a runtime error.
can some one help me understan with an example pls
The above explanation is while we performing Create/Update/Delete operation on record, we have to carefully enough our triggers logics should not suppost to to any Update/Delete operation on same record.
And while we performing Create/Update/Delete operation on record, if trigger on same object tries to modify the other records on same, the possibility of firing the same trigger again and again, it might causes the infinity.
Regards,
Raghu
All Answers
Regards,
Raghu
" Triggers can also modify other records of the same type as the records that initially fired the trigger. For example, if a trigger fires after an update of contact A, the trigger can also modify contacts B, C, and D. Because triggers can cause other records to change, and because these changes can, in turn, fire more triggers, the Apex runtime engine considers all such operations a single unit of work and sets limits on the number of operations that can be performed to prevent infinite recursion. See Execution Governors and Limits.
Additionally, if you update or delete a record in its before trigger, or delete a record in its after trigger, you will receive a runtime error. This includes both direct and indirect operations. For example, if you update account A, and the before update trigger of account A inserts contact B, and the after insert trigger of contact B queries for account A and updates it using the DML update statement or database method, then you are indirectly updating account A in its before trigger, and you will receive a runtime error."
The above explanation is while we performing Create/Update/Delete operation on record, we have to carefully enough our triggers logics should not suppost to to any Update/Delete operation on same record.
And while we performing Create/Update/Delete operation on record, if trigger on same object tries to modify the other records on same, the possibility of firing the same trigger again and again, it might causes the infinity.
Regards,
Raghu