UPDATEFORECOLOR Function (Control)

Microsoft Dynamics Nav 2009

Dynamically changes the setting of the ForeColor Property property of a control.


UPDATEFORECOLOR(ForeColor)

Parameters

ForeColor

Type: Integer

Used to set the new foreground (text) color. Identifies a color by using the RGB Color Model value of the color.

This function is not supported in the RoleTailored client.

This function can only be called from the OnFormat Trigger trigger of the control

The intended use of this function is to display controls of selected records in a tabular form in a specific foreground (text) color. The color set by the ForeColor Property property causes all rows to be displayed in this color. By using this function, you can select individual records where the color should be used, based on, for example, the current value of some other field, like the following cod example.

IF Amount < 0 THEN
  CurrForm.Amount.UPDATEFORECOLOR(255);

This would display the Amount control with red as the foreground color. For detailed information about the integer value to use to specify a color, see RGB Color Model.

Community Additions

ADD
Show: