Timeline for Update Record in before trigger
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 23, 2016 at 6:59 | history | edited | Ashwani | CC BY-SA 3.0 |
added 26 characters in body
|
Dec 23, 2016 at 2:25 | comment | added | cropredy |
more precisely, in your first sentence: In Trigger.new , you cannot reference relationship ...
|
|
Dec 22, 2016 at 21:21 | comment | added | Ashwani | @salesforceDeveloper You don't need to query Opportunity, query Account based on Ids present in Opportunity AccountId. We need Account fields. | |
Dec 22, 2016 at 21:19 | comment | added | salesforce Developer | for(Opportunity op : [Select Id,Account.Checkbox4,Account.Checkbox3,Account.Checkbox2, Account.Checkbox1,Checkbox4,Checkbox1, Checkbox3,Checkbox2 from Opportunity where AccountId IN : accListId]){ system.debug('..33.. '+op); if(op.Account.Checkbox4 != null){ op.Checkbox4 = op.Account.Checkbox4; } } | |
Dec 22, 2016 at 21:19 | comment | added | salesforce Developer | Earlier I was doing same thing but it was not working List<Id> accListId = new List<Id> for(Opportunity opp : Trigger.New){ accListId.add(opp.AccountId); } | |
Dec 22, 2016 at 21:10 | history | answered | Ashwani | CC BY-SA 3.0 |