Sets whether the format that is specified in the Style Property is applied to text in a field.

Important
For backward compatibility only: If set to a Boolean true or false, it sets whether the format specified in the Style property is applied to text in a field.

Applies To

  • Page field controls that are not of type Boolean or BLOB.
Note
This property is not supported in the Microsoft Dynamics NAV Web client or web applications that run on Microsoft Dynamics NAV Portal Framework for Microsoft SharePoint 2010. If the page is displayed in a these display targets, the property is ignored.

Remarks

You can set StyleExpr to either the name of a variable; a text constant in apostrophes, for example, ‘strong’; or, for backward compatibility, to true or false.

If the StyleExpr property evaluates to true, then the value of the field is formatted as specified by the Style Property. You can set the value to true or false, or you can use a variable that evaluates to true or false. The property's default value is false.

Important
You can use a conditional setting of styles by inserting the conditional code in, for example, the OnAfterGetRecord Trigger. Remember to cover all cases in else branches to avoid incorrect styles. For example: if (MyField = 'abc') then   MyStyleVar := 'Ambiguous' else   MyStyleVar :='Favorable'
Note
To use a variable for the StyleExpr property, the IncludeInDataSet Property of the variable must be set to Yes.

See Also