Hsl.attribute
Represents an attribute on the form. Use Hsl.attribute to get an instance of this class.
LookupAttribute and PicklistAttribute have additional methods.
xrmAttribute
attribute.xrmAttribute: Xrm.Attributes.Attribute;
Returns the wrapped xrm attribute.
setVisible
attribute.setVisible(visible: boolean): void;
Sets the visibility for all controls for this attribute.
ℹ️ This method is not simply a wrapper of the out of the box set visible method. It will ONLY set visibility at the control level. The Xrm API's setVisible method will show the containing section if it is hidden. With this method, if the section that the control is in is hidden, the section will remain hidden.
setLabel
attribute.setLabel(label: string): void;
Sets the label for all controls for this attribute.
setDisabled
attribute.setDisabled(disabled: boolean): void;
Sets enabled/disabled status for all controls for this attribute.
setRequired
attribute.setRequired(isRequired: boolean): void;
Sets whether the attribute is required.
getXrmControls
attribute.getXrmControls(): Xrm.Controls.StandardControl[];
Returns an array of Xrm Controls for this attribute.
setFocus
attribute.setFocus(): void
Focuses the first visible control for the attribute.