Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(Opportunity i : opProduct){
- pid.add(i.AccountId);
- }
- List<PriceBookEntry> priceBookList = [SELECT Id, Product2Id,Product2.Name FROM PriceBookEntry where Product2Id=:sub.OrderApi__Item__r.FS_Product__c];
- list<Opportunity> opo = [select id,name,closedate,AccountId,Pricebook2Id,StageName from Opportunity where AccountId in : pid];
- for(Opportunity pro : opo){
- if(pro.AccountId!=null){
- OpportunityLineItem l = new OpportunityLineItem(OpportunityId=pro.id,Quantity=1,UnitPrice=10,PricebookEntryId=priceBookList[0].Id,ServiceDate=system.today());
- li.add(l);
- }
- }
- }
- insert li;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement