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
CK_YoungCK_Young 

how can i make the result.isSuccess()==false

how can i  make the result.isSuccess() to be false?
i wan to test (result.isSuccess()==false)
 
forexample
 
Stirng updateflag = false
Account[] newAcct = new Account(name = 'Acme', billingcity = 'San Francisco');
for(Database.upsertResult result:Account) {
 if (result.isSuccess()==false){updateflag ==false};
}
mikefmikef
CK:

Code:
if(!result.isSuccess()){
   //your statements
}

 should work.

111111
when  result.isSuccess is false?
 
how can i make it to be the false?
 
 
 
TCAdminTCAdmin
Hello 111,

The only way it will return a false is if your insert/update fails. This could be done by leaving a required field blank or if there is a value that triggers a validation rule. It depends on what you are trying to do and how your system is setup.