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

Populate a specific field based on Custom Setting

I am trying to do something in Apex that I think is possible, but I cannot quite grasp how.


I have a parent object that has 5 fields.







These five fields can be populated by "Red", "Yellow" or "Green".


The child object has a picklist where the values are the name of the five fields. 


Field 1

Field 2

Field 3

Field 4

Field 5


If the picklist is not null and one of the field names are selected(with other logic to determine color), I need to populate the corresponding field with the appropriate value.


I know somehow this can be accomplished through Dynamic SOQL, but am at a loss at this point. 


Please help.


Val ValinoVal Valino

Why not just use a regular workflow with field update