control.getAttribute (Client API reference)
Returns the column that the control is bound to.
Controls that aren't bound to a column (subgrid, web resource, and IFRAME) don't have this method. An error will be thrown if you attempt to use this method on one of these controls.
Control types supported
Standard, Lookup, OptionSet
Syntax
formContext.getControl(arg).getAttribute();
Return Value
Type: Object
Description: A column
Remarks
The constituent controls within a quick view control are included in the controls collection and these controls have the getAttribute method. However, the column is not part of the column collection for the table. While you can retrieve the value for that column using getValue and even change the value using setValue, changes you make will not be saved with the table.
The following code shows using the value the contact mobilephone column when displayed on an account form using a quick view control named contactQuickForm. This code hides the control when the value of the column is null.
var quickViewMobilePhoneControl = formContext.getControl("contactQuickForm_contactQuickForm_contact_mobilephone");
if (quickViewMobilePhoneControl.getAttribute().getValue() == null) {
quickViewMobilePhoneControl.setVisible(false);
}
Related articles
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈