0
trigger updatesrno on OrderItem (After insert) {

 if(trigger.isInsert){

       if(trigger.isAfter){
           orderitem.countsrno(trigger.new);
       }

   }

}

Apex class

public with sharing class orderitem {
    public static integer k;
         public static void countsrno(list<OrderItem> olist){

           set<id> orderitemid = new set<id>();
           set<id> orderid = new set<id>();
           for(OrderItem o1 : olist){

               orderitemid.add(o1.id);
           }
}

Error: Compile Error: Variable does not exist: id at line 9 column 32

1 Answer 1

0

There is no list

This

public static void countsrno(list olist)

Should be

public static void countsrno(List<orderitem> olist)

You could just pass in the newMap and no need for the loop

1
  • how to use map.. can you give some idea... thanx
    – pravin
    Commented May 16, 2017 at 9:05

You must log in to answer this question.

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