Now, inside this method I am reteiving various fields of opportunity object and modifying one of these fields. After this, I am updating that opportunity as:
Database.SaveResult updateResult = Database.update(Opp, false);
Here, "AllOrNone" is put as "false" meaning partial update will be success.
Now I have certain fields that are violating some validation rules of opportunity, however the field that I had updated is consistent with requirement. So when this update happens, in database.error I get the message whatever the validation rule message was defined for opportunity
Errors: Database.Error[getFields=(SampleField__C);getMessage=Total amount should be >100000.;getStatusCode=FIELD_CUSTOM_VALIDATION_EXCEPTION;]
However, the field that I had updated did not get updated and still shows old value on UI and in Database.
Is this expected behavior? If yes then won't be putting "AllOrNone" as False be ineffective in this case? And if yes, then how to update that field successfully without having to handle the validation errors.(I have requirement that these validation errors should be ignored in a specific case that I am handling)