ebs.rendering.registerVirtualRelatedAttribute
Registers and relates a virtual attribute to a real one (an attribute existing in the database) belonging to the same entity..
Syntax
ebs.rendering.registerVirtualRelatedAttribute(virtAttrName: string, relatedEntityName: string, relatedAttributeName: string, fieldOptions?: any):
registerVirtualRelatedAttribute(virtAttrName: string, relatedEntityName: string, relatedAttributeName: string, fieldOptions?: IEbsFieldOption): IEbsMetadataVirtualAttribute
| Parameter | Description |
|---|---|
virtAttrName
|
The name of the virtual attribute. |
relatedEntityName
|
The name of the entity to which the attribute you want to relate to belongs to. |
relatedAttributeName
|
The name of the real attribute the virtual attribute will be related to. |
|
|
Specifies field options. In the structure composing this parameter, you can specify the following members of IEbsFieldOption:
|
Response
The type of attribute will be automatically the type of the real attribute. The virtual attribute will take the following properties of the attribute which it’s related to:
- EntityName
- EntityId
- AttributeTypeValue
- AttributeTypeId
- AttributeName (related attribute name)
- AttributeId (related attribute id)
- IsIdentity
- IsReadonly
- Precision
- Length
- RequiredLevel
- RequiredLevelId
- IsLocalizable
- LookupReferenceEntityName
- DefaultOptionSetItem
- OptionSet
If the virtual attribute relates to an attribute of type lookup, it will be of type lookup and will have the same pool of records as the real attribute.
If the virtual attribute relates to an attribute of type optionset, it will be of type optionset and will have the same option set items as the real attribute. If the real attribute has a default selection, also the related virtual attribute will have as default selection that item.
The Edit button next to the virtual attribute allows you to edit it similar to the real attribute.