Using Custom Content Script to Change the Properties of a Field based on Displayed Value (before Sage CRM v7.2)

Less than one minute read time.

Note: This type of customization has become easier in Sage CRM v7.2 using the new Client Side API).

The fields in screens are output with clear 'IDs' that allow the control of the field caption and data to be very easy.

The HTML that makes up the display of a field like the comp_name is clearly divided into different tags each with a clear ID. Each field has a caption and its corresponding data. Each is labelled in the HTML.

e.g.

  • _captcomp_name
  • _datacomp_name

This makes it very easy to be able to address the field in code.

For example the following code added to the custom content of the companyboxlong will change the colour of the data displayed in the Company Status field depending on its value.