I have a Custom Group with two custom fields: Field A is a view only input field (ID: custom_32) Field B is a select with a few options (ID: custom_33).
When the user selects one option from Field B and hits save I would like to add a value to Field A based on the selected option.
Which hook shall I use for this?
I tried civicrm_preProcess, civicrm_postProcess and civicrm_validateForm.
My aproach to the problem is to alter the submitted (empty) value in the form object but it doesn't seem to work.
function insert_value_for_b($formName, &$form){
//determine $newValue
//other business logic
$data = &$form->controller->container();
$data['values']['CustomData'][$customIDforB] = $newValue;
}
Could someone advise please?