0
trigger Ecare_Trg_UpdateContCoreData on Case (after update) {
    List<AccountContactRelation> arcList = New List<AccountContactRelation>();
        for(Case c: Trigger.New)
        {
            if(c.Status =='Closed' && c.Type == 'Commercial' && c.vlocity_cmt__Reason__c =='Change Request' && c.Description == 'Haupaddressdurang')
            {
                AccountContactRelation ct = [SELECT ContactId,AccountId From AccountContactRelation Where AccountId =: c.AccountId];
                    ct.Contact.FirstName = c.First_Name__c;
                    ct.Contact.LastName = c.Last_Name__c;
                    ct.Contact.Salutation = c.Salutation__c;
                    ct.Account.BillingCity = c.City__c;
                    ct.Account.BillingPostalCode = String.ValueOf(c.Postal_Code__c);
                    ct.Account.BillingStreet = c.Street__c;
                    arcList.add(ct);
                System.debug(c.AccountId);
            }      
        }
    if(arcList.size()>0){
        upsert arcList;
    }
}

I need to update the update case details in Account By this trigger i am not able update how we can do it?

0 Answers0