• Shiva Selvi
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Why my custom checkbox is always checked when I try to save as uncheck in the account object?

This is happening only when I have a active trigger. The trigger which I wrote is simple one to check whether that checkbox is "checked" or not, then copy the postal code from Billing address to shipping address. 

When that particular trigger is "Inactive" and tried to save the record with that checkbox as "unchecked" it is working good.
Not sure why this trigger is always "checked" the checkbox when I save the record.

This is my trigger:
Trigger AccountAddressTrigger on Account (before insert,before update) {
       for (Account a : Trigger.new)
   {
           if(a.Match_Billing_address__C = True)
       {
         if(a.BillingPostalCode != NULL)
               {
       a.ShippingPostalCode= a.BillingPostalCode;
                  } 
           }
   }
   
}