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 問題,並以全新的意見反應系統取代並作為內容意見反應的渠道。 如需更多資訊,請參閱:提交及檢視以下的意見反映: