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
111111 

how can i make DML operation was false for this object?

how can i get (!lsr.isSuccess()) == true?
and then i get the updateFlg = false;
 
now i can't get updateFlg = false;
 
 
OpportunityLineItem[] opportunityList
                = BOpportunityLineItemDAO.selectOpportunityLineItem(mitoSakubanBef);
 
 
Database.SaveResult[] SR = database.update(opportunityList);
       
        try{
         
            for(Database.SaveResult lsr:SR){
                //更新失敗の場合
                if(!lsr.isSuccess()){
                 
                    updateFlg = false;
                   
                    break;
                }
            }
        }catch (System.DmlException e) {
         // DmlException例外は呼元へ投る
            throw e;
       
        }catch (System.Exception e) {
            // SFDCシステム例外は呼元へ投る
            throw e;
       
        }