-4
   public void cdperiod(){
        List<Adchrg> lstRec = new List<Adchrg>();
        if(MapSlctChg != null){
            List<Adchrg> rec = MapSlctChg.get('Recurring');
            for(Adchrg chg : rec){
                 chg.amount = ((Decimal.valueOf(chg.originalchg)/ maxDays) * minDays).setScale(2);
                 lstRec.add(chg);
            }   
            MapSlctChg.put('Recurring',lstRec);
            update MapSlctChg.values();
        }
        system.debug(MapSlctChg);

    }

1 Answer 1

4

This error means exactly what it says. An update DML statement requires a list of Sobject types, such as Account, Contact, etc. You are providing a List<List<Adchrg>>, which is not the correct type.

Adchrg does not appear to be an Sobject, so you cannot perform DML on it in any case. Your Map appears to have the type Map<String, List<Adchrg>>. Hence, its values() method returns List<List<Adchrg>>.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .