You need to sign in to do that
Don't have an account?
Alex Waddell 12
Help Apex Trigger: Update Account from Child record
Hello everyone,
I am trying to write a Trigger that looks at the number of Communication_Note__c records exist in an account and when there are 3 notes of the outcome "No Answer" update a field on the Account called "Fuzion Billing Date" with the Created date of the third note
Right now i am getting the error on line 12; "Variable does not exist: Fuzion_Billing_Date__c".
I believe this is because i need some sort of nested querie that ties the Parent Account and its Fuzion_Billing_Date__c to each Communication_Note__c record
Can anyone help me with this please?
I am trying to write a Trigger that looks at the number of Communication_Note__c records exist in an account and when there are 3 notes of the outcome "No Answer" update a field on the Account called "Fuzion Billing Date" with the Created date of the third note
Right now i am getting the error on line 12; "Variable does not exist: Fuzion_Billing_Date__c".
I believe this is because i need some sort of nested querie that ties the Parent Account and its Fuzion_Billing_Date__c to each Communication_Note__c record
Can anyone help me with this please?
trigger BillingDate2 on Communication_Note__c (After insert) { List<Communication_Note__c> allCom = new List <Communication_Note__c> ([Select Id From Communication_Note__c where id in :Trigger.new AND Fuzion_Type__c = 'Initial Phone Call' AND Outcome__c = 'No Answer']); List<Account> myAcc = New List<Account>([Select Id, Fuzion_Billing_Date__c From Account]); If(allcom.size() == 3){ myAcc.Fuzion_Billing_Date__c = Date.Today(); } }
Amit Chaudhary 8
try to update your code like below