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
vijendharvijendhar 

checkbox is set to false whenever the parent record or related child record are modified

Hi All,
   i have a requirement on account to contact objects, in that in contacts object have once check box export=true , if data  have changed in  account  or contact objects then export has to be false( export =false.  ) in contact object. 
   can any one have best solution or code for it could u share with us
   
Thanks All
SaranSaran
Hi vijendhar,

If changes are modified in contact you can update that checkbox with the help of workflow rule.

But if any changes in account then you have to write a after update trigger in account and update the contact values.

Hope this helps you!

Thanks.
Adapala KullayappaAdapala Kullayappa
Hi ,

  trigger updatefields on Contact(before update,After update){
         if(trigger.isbefore){
        contact consv=new contact();
            for(contact conesc:trigger.new){
                if(consv.checkbox__c==false){
                    conesc.mobilephone=conesc.phone;
                }
            }
        }
           if(trigger.isafter){
         
             list<Account> chk=[select id,BillingCity,ShippingCity,Fax,Phone,(select Checkbox__c from contacts) from Account];
             list<Account> lisacc1=new list<Account>();
          
             for(Account liscvs:chk){
                 for(contact liscones:liscvs.contacts){
                 if(liscones.checkbox__c==true){
                   liscvs.phone=liscvs.fax;
                   }
                 }
                 lisacc1.add(liscvs);
             }
             update lisacc1;
         }
}



try to this help hopes

Thanks 
kullayappa
9731512878
vijendharvijendhar
Hi kullayappa,
   tnx for your replay.  i solved this by  issue modifying some code in apex class . and your anser also helped me to learn new way.

Vijendhar
 
king kullaiking kullai
hai 
                 this kullayappa i am looking fresher salesforce job do have any openings could please help me


thanks
kullayappa
9731512878