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
NajoopNajoop 

Update Trigger not updating the field

Hi,
 
I am new to SF APEX, need some help.
 
I have written this trigger to check a check box in Account object whenever a new record is created in custom Object.
Custom object has Account name as related lookup field.
 
TheTrigger is compiled and saved but it never updates the check box when a new record is created in custom object.
 
Any help is appreciated, Poojan
 
this is the code
trigger UpdateAccountCustomAsset on Custom_Asset__c (after insert) {

     for (Custom_Asset__c c: Trigger.new)
       {
        Account a = new Account(Id = c.account__c);
        a.Custom_Asset_available__c = True;
        update a;
        }
}
lnryanlnryan
Did you check to see if the trigger is active?
NajoopNajoop
Yes, Is Active checkbox was checked when I saved it