You need to sign in to do that
Don't have an account?
Randy Rose
Collection and field definition
I'm interating through an sObject and Opportunity Id exists in the sObject.
I want to move some Opportunities to a collection and a custom field (e.g. campaign) and then when done iterating through the sObject do a bulk update for the Opportunity.
What type of collection should this be and how do I define the field in the collection (these opportunites already exits)?
Example
Lets call sObject campaigns
<list><map> Opps;
for (Campaigns campaign:coCampaigns :) {
Opps (collection?) = campaign.get('campaign__Opportunity__c')
Opps.campaign (collection?) = campaign.get('campaign__c')
}
update Opps (collection);
I want to move some Opportunities to a collection and a custom field (e.g. campaign) and then when done iterating through the sObject do a bulk update for the Opportunity.
What type of collection should this be and how do I define the field in the collection (these opportunites already exits)?
Example
Lets call sObject campaigns
<list><map> Opps;
for (Campaigns campaign:coCampaigns :) {
Opps (collection?) = campaign.get('campaign__Opportunity__c')
Opps.campaign (collection?) = campaign.get('campaign__c')
}
update Opps (collection);
pcon
Your psuedo code doesn't make much sense in the terms of Apex. I will give you the following code that shows how to use lists in Apex, but if you want more clarification around how to use them in your specific instance, please include more information. A diagram (or screenshot) of your object definition would be helpful.