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
NatrajNatraj 

Updating a list

Hi All,

 

I am updating a list of records from visualforce page with the help a update button. What i need here is .. lets take for example i have a list of 10 records and i have given correct values for some 5 records and incorrect values for other 5 records. When i click update i want the partial update i.e., i want the 5 records with the correct value to get updated and i need to get

 

I used DML database methods. but i am not getting clear.

 

 

 

Thanks in Advance.

kiranmutturukiranmutturu

hope you are getting all the 10 records in to controller then..in the action method before the dml statement filter the list of 10 records with your respective check and add them to a new a new list and insert the same....

NatrajNatraj

Kiran,

 

First of all thanks!!!

 

But what i am trying to achieve is ..... Imagine that we are having a validation rule for an object for a particular field...

In this case i need to update the records which is having the correct values and i have to  get back the ones which fails for validation rule. Hope you got it

abhishektandon2abhishektandon2

Use Database.update(List fo records,false)

 

This will update the 5 records and rest 5 would get rejected because of the validation rule failure