I am creating an extension. I created a custom group and custom field. The data and input field type is alphanumeric and select. I want to add multiple choice option into that custom field using an extension.
You can use managed hook to create custom field on install
- Create Option Group 2.Create option values for option group
- Create custom group
- Create custom field.
There is another way of doing this i.e by creating xml file. A good example to refer would be https://github.com/compucorp/civihr/blob/master/hrcareer/xml/auto_install.xml
It sounds like you are looking for this hook: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_fieldOptions/
It lets you set the values in the select dropdown on-the-fly.