Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by dsfdf ( 12 years ago )
List<Opportunity> opps = [
   select Account.Id
    from Opportunity
    where 
  StageName = 'Условный отказ'
];

List<Id> accIds = new List<Id>();
for (Opportunity item : opps) {
 accIds.add(item.Account.Id);
}

 List<Contact> c
    select Id
  from Contact
    where
         AccountId in : accIds
];

Id campId = '701b0000000DnyR';

List<CampaignMember> result = new List<CampaignMember>();
for (Contact item : contacts) {
      result.add(new CampaignMember(C ,CampaignId = campId, Status = 'Отправлено'));
}

system.debug('result.size = ' + result.size());

//insert result;

 

Revise this Paste

Your Name: Code Language: