Configuring the UI

Now that we have defined our EntityGroupType, we can create a UI that allows users to create EntityGroups of that type. The JavaScript component for this UI, One.form.EntityGroup, is a core Platform component so all we require is a UIMM entry which references this component. For more information on the UI Metamodel, see UI Metamodel.

<WebAction name="createMyEntityEntityGroup">
    <PanelOptions>
        <PanelClass>One.form.EntityGroup</PanelClass>
        <PanelConfig>{entityGroupType: "MyEntity", ownerType: 'User'}</PanelConfig>
    </PanelOptions>
</WebAction>

The WebAction above is a standard WebAction definition which references the EntityGroup UI component. The one thing to note here is the PanelConfig which names our EntityGroupType("MyEntity") and ownerType("User"). This config tells the UI component which EntityGroupType it should allow the user to create.

Another important parameter to pay attention is ownerType. ownerType value can be one of "User", "Organization", "Enterprise", and "Value Chain" types. ownerType determines who can access EntityGroups created by me. If the ownerType is "User", only the user who created the Entity group can access the record. If it is "Organization", any user within the creation user's organization can access the record. If it is "Enterprise", any user within the creation user's enterprise can access the record. Finally, if it is "Value Chain", any user within the creation user's Value Chain can access the record.

This screenshot shows the resulting UI. By changing the drop-down, the user can switch between available model types. Using the picker, they can choose from the available models of that type. The picker has the AutocompleteSqlName and the PickerReportName from the type definition applied to it.