You need to sign in to do that
Don't have an account?
Jamal Arogundade
Create allocation for a new opportunity
// Query Opportunities where Stage is pledged , The SOQL will have Recurring Donation ID as well in WHERE condition
// run a loop on List of Opps reterived in step 1
// Create Allocation for each opp, Allocation you have created, should be added to a new list of type Allocation__c
// Insert Allocation lIts
List<Opportunity> oppList = [SELECT ID FROM Opportunity WHERE StageName = 'pledged'];
for (Opportunity opps: oppList){
Allocation__c alls = new Allocation__c ();
alls.Opportunity__c = opps.id;
}
insert oppList;
}
// run a loop on List of Opps reterived in step 1
// Create Allocation for each opp, Allocation you have created, should be added to a new list of type Allocation__c
// Insert Allocation lIts
List<Opportunity> oppList = [SELECT ID FROM Opportunity WHERE StageName = 'pledged'];
for (Opportunity opps: oppList){
Allocation__c alls = new Allocation__c ();
alls.Opportunity__c = opps.id;
}
insert oppList;
}
Jamal Arogundade
FYI: I am a newbie to Apex, would like some help on fixing this code