Skip to main content
I have trigger on Account (before insert), it is working fine when I create an account manually but when i tried to test while inserting records using dataloader it did not work..

 

Here is the code:

 

trigger  Name on Account (before insert)

 

{

 

    for(Account a : Trigger.new)

 

    {

 

        if(a.FieldName =='abc')

 

        {

 

            a.FieldName__c = 'Value';

 

        }

 

  }

 

}

 

And is there any way I can make this to work on bulk inserts...

 

Thank you for the help in advance.

 

Regards,

 

Paddy
1 answer
  1. Oct 25, 2013, 4:48 AM
    Hey Paddy,

     

    This should definitely work!

     

    Are you sure that the Account meets the criteria (a.FieldName == 'abc') when uploading via Data Loader?  It must be case-sensitive!

     

    Salesforce doesn't really make any distinction between uploads via Data Loader or manual updates, so there's no need to worry about that aspect.

     

    You can also check the debug log to see what's happening:

     

    http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_debugging_debug_log.htm

     

    Finally - check out this site - it's great if you're learning Apex!

     

    www.sfdc99.com

     

    Hope this helps!

     

    David