Notifications

14 views

Symptoms


When trying to change the background color of a reference field, the following does not work:

 

g_form.getControl('reference_field').style.backgroundColor = 'red'

 

The above will work for other field types, except not for reference fields.

 

Release


All

  

Cause


The getControl() method is not appropriate for reference fields.

 

Resolution


The right method for reference fields is getDisplayBox(), like so:

 

g_form.getDisplayBox('reference_field').style.backgroundColor = 'green'

 

Article Information

Last Updated:2019-02-13 16:54:13
Published:2019-02-13