You need to sign in to do that
Don't have an account?
jpwagner
Trigger to update a different object on insert
I would've thought this would work...
trigger ContactLookupOnInsertTrigger on Contact (before insert) { for (Contact c : Trigger.new){c.Account.SomeField = someValue;}}
But it doesn't. Any thoughts/suggestions?
Thanks.
trigger myTrigger on Contact (after insert) {
List<Account> accts = new Account[]{};
for (Contact c : Trigger.new) {
Account acct = new Account(id = c.AccountId, someField = c.someValue);
accts.add(acct);
}
update accts;
}