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
Pranav_VaidyaPranav_Vaidya 

Database.SaveResult gives error

Hi,

 

Below is from my controller extension class. I have a VF page with standard controller as a custom object.

For the below line of code I get an error - Illegal assignment from Database.SaveResult to LIST<Database.SaveResult>

 

Code:

Database.SaveResult[] MySaveResult = Database.Insert(currTrip, false );

 

My code line is exactly as given in the Apex Developer's guide. I don't understand what's going wrong here!!

Any help is much appreciated.

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
Pranav_VaidyaPranav_Vaidya

I don't believe myself...such a silly mistake

 

Resolved...changed the code to Database.SaveResult MySaveResult = Database.Insert(currTrip, false );

 

Thanks.

 

All Answers

Pranav_VaidyaPranav_Vaidya

I don't believe myself...such a silly mistake

 

Resolved...changed the code to Database.SaveResult MySaveResult = Database.Insert(currTrip, false );

 

Thanks.

 

This was selected as the best answer
Bullfrog84Bullfrog84
So it's not a mistake? The documentation is wrong as I ran into the same issue... 6 years later.