You need to sign in to do that
Don't have an account?
Trying to add Opportunity ID to a List from Allocation Trigger
Hey, I have a trigger on the allocation that is trying to loop through the associated opportunities. Here is the code:
List<Opportunity> donations; for(Payment_Detail__c pd :Trigger.new){ donations.add(pd.Donation__c); system.debug(pd.Donation__c); for(Opportunity o : donations){ // do action here
} }
Incompatible element type Id for Opportunity, although it is the field that holds the ID of the Opportunity (Donation)
Hello,
In a List of Opportunity, you can not add obj of Pyment_Detail__c (for that matter any obj other than opportunity obj).
What exactly you want, I'm not getting. May be i can help you out on that
-Sunil
I am trying to get the opportunities associated with the Allocation. I want to loop through the opportunities and perform updates to each associated to the effect allocation.
in your code you are not instantiating your list:
and refer to the relastionship name not the field name
Ex: