Edit EnumBundle based on Enum CustomField name
Hi,
I need to alter values of global EnumBundle based on Enum field name.
Knowing the name of the CustomField I can:
1. list all CustomFields /api/admin/customFieldSettings/customFields?fields=id,name
2. iterate them to find id
corresponding to specific name
3. get properties of this CustomField /api/admin/customFieldSettings/customFields/{fieldID}
4. get or update specific EnumBundle /api/admin/customFieldSettings/bundles/enum/{bundleID}
But I cannot determine which bundleID
is used in specific fieldID
that I want to alter. Is it possible?
Please sign in to leave a comment.
Hi Adam Frankowski. The CustomField entity has the
fieldDefaults
attribute. In case of an enum field, it will have the EnumBundleCustomFieldDefaults type. In this object, you can request itsbundle
attribute to get the ID of the default bundle in the field.In the example above,
96-99
is the custom field ID, and requestingfieldDefaults(bundle(id))
should provide the expected result.YES, that's exaclty what I was looking for, thank you!