I have an Entity A that has an attribute/field that is itself a pretty complex entity (B).
For the field I want to display text that says the name of the field and then a button that says something like “Click here to examine B” and it will pop up B’s edit page.
How can I do this with a custom field in a FieldGroup? The issue is that if I do it with a label and a button outside the field group, it doesn’t line up well.
I should have mentioned there’s a one-to-one relationship between A and B. If A gets deleted, B should get deleted as well. If B gets deleted, A should not get deleted.
Anyway, PickerField would be the right field except since there’s only one, there’s no lookup/picking to be done.
Also, if B doesn’t already exist, how can I get the lookup action to create it?
First of all, if you need only one action in PickerField, just tune actions set. Let say we have Client entity with a reference field - manager, that is assigned automatically while creating a record of Client:
Here we inject instance of PickerField from a field group and on init stage we change actions set, just add OpenAction.
If this approach does not suit your needs you can always create a composite custom field. We set name of a method that will generate custom field to generator attribute of a field: