Creating an EntityGroupType

Creating an EntityGroupType is just like creating any other model and should be done via XML and loaded into the database as part of the dataset. EntityGroupType has a name, a description, and a list of EntityGroupMemberTypes which describe the models that are allowed into EntityGroups based on this type. An example will illustrate it best:

<ModelList xmlns="http://www.onenetwork.com/Platform">
<ValueChainId>9123</ValueChainId>
<CustomModelName>Standard EntityGroupType</CustomModelName>
<ActionName>PLT.InsertOrUpdate</ActionName>
<EntityGroupType>
<ValueChainId>9123</ValueChainId>
<Name>MyEntity</Name>
<Description>My Entity</Description>
<EntityGroupMemberType>
<PermissibleType>User</PermissibleType>
<ModelLinkAutocompleteSqlName>ZBKS.EGPickers.UserPicker</ModelLinkAutocompleteSqlName>
<ModelLinkPickerReportName>ZBKS.MyUserReport</ModelLinkPickerReportName>
</EntityGroupMemberType>
<EntityGroupMemberType>
<PermissibleType>Site</PermissibleType>
<ModelLinkAutocompleteSqlName>ZBKS.EGPickers.SitePicker</ModelLinkAutocompleteSqlName>
<ModelLinkPickerReportName>ZBKS.MySiteReport</ModelLinkPickerReportName>
</EntityGroupMemberType>
</EntityGroupType>
</ModelList>

In the above example, we have a basic EntityGroupType which is named "MyEntity". This EntityGroupType has two EntityGroupMemberTypes which describe the possible members: one for User and one for Sites. You can also see that we've specified the optional values for the AutocompleteSqlName and the PickerReportName which will be set on the ModelLinkField used to select the members. More on that in the next section.