• Jes@NZ
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies

Hi everyone

 

My first trigger in salesforce, is working in sandbox but I'm having a problem with the coverage.

 

I was already reading about it and couldn't find a solution, can anyone help?

 

I'm a new at salesforce so any help will be more than welcome.

 

The code is:

 

trigger AccountTrigger on Account (before insert) {
    
    List<Account> lst_in = trigger.new;
      for(Account acc:lst_in){
      
         
         acc.ShippingCity = acc.BillingCity;
         acc.PersonMailingCity = acc.BillingCity;
         acc.PersonOtherCity = acc.BillingCity;
    
         acc.ShippingStreet = acc.BillingStreet;
         acc.PersonMailingStreet = acc.BillingStreet;
         acc.PersonOtherStreet = acc.BillingStreet;
   
         acc.ShippingState = acc.BillingStreet;
         acc.PersonMailingState = acc.BillingState;
         acc.PersonOtherState = acc.BillingState;
       
         acc.ShippingPostalcode = acc.BillingPostalcode;
         acc.PersonMailingPostalcode = acc.BillingPostalcode;
         acc.PersonOtherPostalcode = acc.BillingPostalcode;
 
         acc.ShippingCountry = acc.BillingCountry;
         acc.PersonMailingCountry = acc.BillingCountry;
         acc.PersonOtherCountry = acc.BillingCountry;
    
   }
}

 

The errors are:

 

AccountTrigger

      Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required Deploy Error      

      Average test coverage across all Apex Classes and Triggers is 66%, at least 75% test coverage is required.

 

I can understand that I will have to tweak the code to have more than the minimum expected, but how?

 

Thank you

Hi,

 

I want to access mobile camera from salesforce VF page to capture photo and save it in salesforce object.

 

Please help me. Thanks in advance.

 

OM