I have a Custom Field Type developed in Forge. I would like to make sure that whenever someone creates a new Custom Field of this type, its default value is automatically set to a preset string. How is this possible to achieve?
You can use REST API to set default value for custom field:
I’ve tried this but I didn’t seem to be able to automate it with Forge. I created a trigger for the field creation event where I tried setting a default value to the newly created field right away, but it seemed to me that at the time the trigger fired, the new field hadn’t been created yet. As far as I remember, I got a HTTP 404 when trying to set a default value on this field. Is this the expected behavior? Can I somehow fire a trigger right after a new custom field (instance) has been created?
The API for setting default values requires context of the custom field. Therefore, I believe, you should listen to the