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
HTH
Pradeep
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.
-
How to add values for the custom field using API explorer v3? (support -> Developer ->API explorer v3). – Dipak Giri Dec 14 '18 at 6:07
-