First, a quick note: You do not need to re-query the records. Trigger.new already contains the field values for the Account, including Id, abc__c, and efg__c. You only need to query during execution of the trigger for related records and their field values.
The code, as shared, would not compile because there is no such method fieldUpdate_Handler.afterUpdate(List<Account>, Map<Id, Account>)
. I'm assuming you would have figured that out on your own though.
So assuming that it compiles and runs when you write it as an after update trigger, but not an after insert trigger, your problem would be that Trigger.oldMap does not exist in the insert context. The reason it does not exist is because that map contains the prior state of the record before the update that caused the trigger to fire, and in the insert context the record is new and therefore there is no prior state.
Finally, for a trigger that is reading one value on a record and updating another value on the same record, it's best to use a before trigger which eliminates the need for DML statements and the possibility of recursive trigger execution (recursive trigger execution occurs when an after update trigger updates the record causing the after update trigger to update the record causing the after update trigger to update the record forever until it crashes into a governor limit). A before trigger is simpler and more efficient and fully meets the requirements you've laid out here. You could modify your code like so:
public class fieldUpdate_Handler {
private static final String ABC_PROCESSING = 'Processing';
private static final String EFG_INITIAL_REVIEW = 'Initial Review';
public void beforeInsert(List<Account> newAccounts) {
setEfgValue(newAccounts);
}
public void beforeUpdate(List<Account> newAccounts, Map<Id, Account> oldMap) {
setEfgValue(newAccounts);
}
private void setEfgValue(List<Account> newAccounts) {
for(Account acc: newAccounts) {
if(acc.abc__c == ABC_PROCESSING) {
acc.efg__c = EFG_INITIAL_REVIEW;
}
}
}
}
trigger fieldUpdate on Account (before insert, before update) {
if(Trigger.isBefore) {
if(Trigger.isInsert) {
fieldUpdate_Handler.beforeInsert(Trigger.new);
} else if(Trigger.isUpdate) {
fieldUpdate_Handler.beforeUpdate(Trigger.new, Trigger.oldMap);
}
}
}
Having the insert and update triggers call into different handler methods will allow for having some processes that run in the update trigger that do need the oldMap while still having both share a common method to set the picklist value, but besides that you can eliminate some complexity by just updating the records in the loop since before triggers are in a pre-DML context and there's no need to create a separate list.