25 May’18

D365 Business CentralHow to change the font colour of a List page based on a condition in Dynamics NAV

Intoduction:

The requirement was such that, based on a condition certain lines should appear in Red.This can be done by using page control Style Property. The Style property has ten values that apply different formats to field text as below:

Value Format
Standard Standard
StandardAccent Blue
Strong Bold
StrongAccent Blue + Bold
Attention Red + Italic
AttentionAccent Blue + Italic
Favorable Bold + Green
Unfavorable Bold + Italic + Red
Ambiguous Yellow
Subordinate Grey

Pre-Requisites:

Microosft Dynamics NAV 2017

Steps:

1. Create a global variable i.e. on the View menu, choose C/AL Globals.

2. Define the variable, and then set the DataType to Boolean.

3. Open the Property of the variable then set the IncludeInDataSet to Yes. (I’ve use CFS_Repo as my boolean field).

4. Create a local function. (in my case UpdateStyle).

5. Now, code in the function. My requiremnt was such that if field  RepoInitiated is true then the line should should appear red. You can code as per tour requirement.

6. On the trigger OnAfterGetCurrRecord, call the function.

7. Now select the Field in the List page and click on Properties (Shift + F4)

8. Set the Style to Unfavorable and StyleExpr to CFS_Repo (the boolean field )

9. Repeat the step 8 for all fields present on the list page.

Written by

Chris D'Silva

Software Developer

2 thoughts on “How to change the font colour of a List page based on a condition in Dynamics NAV”

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Performing Update operation in Microsoft Dynamics NAV through Integration in Scribe Online

    13 November’ 2019

    Introduction: Use the Update Block to update existing records in the source or target datastore. While integrating w...

    Read more
  • Adding Microsoft Dynamics NAV Connection in Tibco Scribe Online

    13 November’ 2019

    Introduction: Establishing a connection is an important step before developing a solution for Integration. While integra...

    Read more
  • Time zone Conversion from Microsoft D365 for SSRS Reporting

    6 November’ 2019

    Introduction: Converting Date/Time values according to a time zone is quite challenging task in SSRS Reporting. For D365...

    Read more
  • How to Synchronize Office 365 and Zoho People?

    4 November’ 2019

    If your organization is using Zoho People and Office 365, you will find this article very useful. In this article we are...

    Read more
  • Check Plugin Timeout issues using Tracing in D365 CE

    31 October’ 2019

    In Dynamics plugin implementations, you might have lengthy complex plugins that makes calls to Dynamics several times. I...

    Read more