try{
}catch(DMLException e){
         for (Integer i = 0; i < e.getNumDml(); i++) {
            // Process exception here
                System.debug(e.getDmlMessage(i));
                LineItemList [i].adderror(e.getDmlMessage(i));
        }

     }

Written by 

3x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published.

*