i have 2 custom fields named color__c in the object Case and Account, before i create a case, i would like to copy the value in Account.color__c to Case.color__c in the trigger before inserting whitout creating a formula field, just by calling a copyColorField method and using the accountId relationship, i would like to know if it's possible without using another soql in the after insert trigger for exemple ?
public static void copyColorField(List<Case> caseListToEdit){
}
// exemple with two accounts having black and red color value in color__c field
Case c1 = new case(Subject = 'Test 1', AccountId = '0011l0000101uM9854');
Case c2 = new case(Subject = 'Test 2', AccountId = '0011l0000101uM9844');
Case [] inputCases = new case[]{c1,c2};
insert inputCases;
// expected result after insert
--> Case:{Subject='Test 1', AccountId=0011l0000101uM9854, color__c='black'}, Case:{Subject='Test 2', AccountId=0011l0000101uM9844, color__c='red'}