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
Julian Juez AlfaroJulian Juez Alfaro 

Apex trigger to update case field when solution is linked

I would like to have a custom number field in the case object whenever a solution is linked to the case. Let's say that this custom field is called "Has Solution":

If 0 solutions are linked to the case, "Has Solution" should be "0"

If 1 or more solutions are linked to a case, "Has Solution" should be updated with the number "1".

 

Is this possible?

 

Is it possible to have this for existing cases that will never be updated?

 

Thank you very much!

Julian.