function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lakshmi SLakshmi S 

Trigger Issue ?

Hi Team,

I have installed some packages in my org, related to those packages there are 4 or 5 triggers in Account object. I need to write a custom trigger on Account object.

Please advise can we write custom trigger, if we have triggers on same object related to packages ?

Thanks,
Lakshmi S.
Ajay K DubediAjay K Dubedi
Hi Lakshmi,
Yes you can create our own trigger on any objects there is no issue will create due to package.
To create a trigger you can refer the below link:

Link: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers.htm

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
kailash chandrakailash chandra
Hi Lakshmi,

Yes, You can write your own custom trigger on Account sObject.

Multiple Trigger On same sObject
This rule identifies the presence of multiple Apex triggers associated with the same sObject. Simply having triggers on the same sObject is not an issue. However, it is possible to have redundant code or logic executed in the multiple triggers. Examining multiple triggers may be a way to enhance and improve the code. Please be aware that there is no guarantee the order in which multiple triggers on the same sObject execute.
Apex best practice  : write on trigger on one Sobject by using Trigger Context Variables  Trigger Context Variable (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_context_variables.htm)

If you want to this trigger in production then you have write this trigger in sanbox and deploy this trigger in your production org by using change sets.
http://www.sfdc99.com/2013/06/04/how-to-deploy-code-from-sandbox-to-production/
I hope this will help you.

Kindly mark this as solved if the reply was helpful.

Thanks,
Kailash Chandra