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
cricketlangcricketlang 

Trigger To Update Custom Account Fields

We are new to Apex here and are trying to develop a simple trigger that will update a few fields on account from a custom object we have. Although this seems like a simple trigger, i cannot find any documentation to really help with what im looking to do. Any help is very much appreciated

MiddhaMiddha

You can create a trigger on your custom object with "after update" and "after insert" events. You can get the complete information in the APEX document. If you let me know the exact requirement, i might be able to help you. 

cricketlangcricketlang

Thanks for your help! I'd be glad to provide you with additional information.

 

We have a custom fields on the account level one being Objective__c (all are just text fields)

 

these field values carry over from object to object through formula fields (so opportunities, campaigns, etc)

 

We have a custom object called "Phase III". This is simply an object meant to update the account fields from other objects. so the user clicks a button in the desired object (Buttons are already setup) and the Phase III record is populated with the account values and is presented in edit mode. What we need is for the save button here (on the Phase III object) to initiate the trigger to take the values in those fields (all listed below) and update the corresponding fields on the associated accoun. Does this make sense?

 

Fields are named the same in accounts and in Phase III

 

 

Object Name: Phase_III__c Field Names (named the same on account and phase III): State_Of_The_Union__c Objective__c Critical_Success_Factors__c Customers_Strategy__c Winnable_Position__c Supporting_Tactics__c Competitors_Strategy__c