function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pradeep naredlapradeep naredla 

Getting an error while trying to put some values into a map

Map<Id, list<Opportunity>> ret = new Map<Id,list<Opportunity>>();
       for(Opportunity order : orders)
       {
      //list<Opportunity> POSO= [SELECT Invoice_Reference_Opp__c,AccountId,Amount,Net_cost__c,VAT__c,StageName,Additional_Order_Information__c from opportunity where opportunity.id=:order.id];
   ret.put(order.Id,new list<opportunity>(order.Invoice_Reference_Opp__c, order.AccountId, order.CreatedDate.getTime(), order.Amount, order.Net_cost__c, order.VAT__c, order.StageName, order.Additional_Order_Information__c));
          //ret.put(order.Id,new list<opportunity>(Invoice_Reference_Opp__c,AccountId,Amount,Net_cost__c,VAT__c,StageName,Additional_Order_Information__c from opportunity where opportunity.id=:order.id) );
           //ret.put(order.Id,POSO);
           ret.get(order.Id).Products = new List<POSProductDetailReturn>();
           order.Sent_to_POS__c = true;
          
       }

GETTING ERROR AS

Error: Compile Error: expecting a right parentheses, found ',' at line 19 column 73
ShashankShashank (Salesforce Developers) 
There must be some syntax problem, probably here:

//ret.put(order.Id,new list<opportunity>(Invoice_Reference_Opp__c,AccountId,Amount,Net_cost__c,VAT__c,StageName,Additional_Order_Information__c from opportunity where opportunity.id=:order.id) );

try commenting it correctly:

/*
ret.put(order.Id,new list<opportunity>(Invoice_Reference_Opp__c,AccountId,Amount,Net_cost__c,VAT__c,StageName,Additional_Order_Information__c from opportunity where opportunity.id=:order.id) );
*/