+ Start a Discussion
Paula VoglerPaula Vogler 

Will triggers fire during import/integration of records?

We have an existing trigger that automatically creates a Contact record when a user creates an Account record in the UI. 
It starts like this: 
trigger AddContact on Account (after insert) {
/* They wanted to add the Contact when the Account was created.  If Other Person is filled in it creates two Contacts.
One with Account name nad one with Other Person name - oth have same phone and email

We are now going to user Jitterbit to migrate Account records over from another legacy system. I'm wondering if the trigger should still fire when the accounts are imported and create a Contact or if it only runs in the UI?
sivaextsivaext
Hi, 

Trigger will fire and create new contacts. 

Make sure your  trigger is bulkfied.
ra1ra1
Hi Paula,

As Sivaext suggested triggers will fire whenever anyone creates Account (either from UI or from any ETL tool). 

Still, you can bypass trigger by choossing any of below listed suggestions :

1. Use "Custom Label" as flag and before loading legacy data keep this flag as TRUE. Trigger code will look like :
     trigger AddContact on Account (after insert) {
        if(System.Label.LOADING_LEGACY_DATA == FALSE) {
           // create contact
        }
     }
  
   Once you are done with data load, you can update "LOADING_LEGACY_DATA" flag as FALSE. This can be usefull only if you have pre-define DOWN TIME.

2. If your JitterBit user is belong to Specific PROFILE / ROLE then you can exclude the trigger if running user belong to same. For Example : 
    trigger AddContact on Account (after insert) {
       Profile dataloaderProfile = [select id, name from Profile where name = 'Data Loader'];

        if(UserInfo.getProfileId() != dataloaderProfile.id) {
           // create contact
        }
     }   


You can go with any of above option of can create respected condition which suits your requirement.

Thanks!! :)
Vinit_KumarVinit_Kumar
Yes Paula,

Trigger would fire whenever you do any insertion of Account,doesn't matter if it is from UI or API or it is for Single record or bulk record(provided your code is bulkified to handle bulk operation).

In every situation Trigger would fire.If you don't want the Trigger to fire go ahead and deactivate it,once you are done with your loading,you can then re-activate it.