You need to sign in to do that
Don't have an account?
Nandini
Database.update for List and Map ?
Hi Team,
I have a doubt on Database.update .
Database.update(oppToUpdate,false); In this statement what is the use of ' false' , is it mandatory ? ( passing list obj).
Database.update(mapToUpdate.values()); In this statement we need to put ' false' or not necessary. (passing map).
Please let me know.
Thanks,
Nandu.
I have a doubt on Database.update .
Database.update(oppToUpdate,false); In this statement what is the use of ' false' , is it mandatory ? ( passing list obj).
Database.update(mapToUpdate.values()); In this statement we need to put ' false' or not necessary. (passing map).
Please let me know.
Thanks,
Nandu.
Database.update(mapToUpdate.values()) --> Your are not passing any values to the second param to its defualt false .. and your are passing the values from the map i.e list
Modifies one or more existing sObject records, such as individual accounts or contactsinvoice statements, in your organization’s data.
The optional allOrNone parameter specifies whether the operation allows partial success. If you specify false for this parameter and a record fails, the remainder of the DML operation can still succeed. This method returns a result object that can be used to verify which records succeeded, which failed, and why. If the parameter is not set or is set true, an exception is thrown if the method is not successful.
Here is a solution to your Problem.
The (True/False) parameters are optional that specifies whether the operation allows partial success. If you specify false for this parameter and a record fails, the remainder of the DML operation can still succeed. This method returns a result object that can be used to verify which records succeeded, which failed, and why. If the parameter is not set or is set true, an exception is thrown if the method is not successful.
and for Map, it's by default False.
I hope it will help you.
Please select this as Best Answer so that other's also get help from this.
Thank You
Ajay Dubedi