I'm trying to populate a field whith several others. I know nothing about coding so ... After few research I did that:
1 trigger Updatelookup on Event (before insert, before update){
2 for (event u : Trigger.new){
3 u.lookup_contact__c = u.WhoId;
4 u.Subject = u.Nom_formate__c + u.Raison_visite_formate__c;
5 }
6 }
The line 1, 2 and 3 works well. It populaite my custom lookup field from the WhoId lookup field (Yes it's possible to create custom lookup fiel in event now. but you have to ask to enable it)
My problem come with the line 4. Nom_formate__c is a formula field that take first and last name through the "lookup_contact__c". Because the WhoID lookup is populated after the triger, this part stay empty exept if I update the event.
So, I need to know if it have a way to do the triger after the formula is populated. (I have an error ir I write " after insert"
Thx a lot for your help
update Trigger.new.clone()
in an after insert, then check the formula value in before update trigger. YMMV.