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
Oleg NikitchukOleg Nikitchuk 

Apex DML Query

Hi all, 

I am writing a class with several methods, I have completed some while struggling with others.

1) One method should return Database.SaveResultId with input parameters(dealId, Map<String, Object> fieldNameToValue. It should update deal with values in a map. Can't figure this out, maybe someone can share a pattern.

2) Second method is void, it has(Id carId) as input parameter. The logic behind it: Car got broken. Update all open deals for this car with Status Lost. Car's IsAvailableForRent set false.

Please, advise.