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 throw new DmlException('fd');

i got the error

  Variable does not exist 

 

if(!lsr.isSuccess()){
                updateFlg = false;
                throw new DmlException('fd');
                break;
            }

micwamicwa
I don't think that you can create a DMLException yourself and thorw that, a DMLException will be thrown from the System.
If you would like to throw an exception you have to implement your own (class MyException extends Exception).