Styling Dynamics NAV 2013 Page Values

ERP is all about providing critical information to the users with very user friendly manner. Therefore It is always essential to draw attention to the important values, fields in a page. It allows the user to use the ERP very user friendly manner and allow to provide very critical information in very simple manner.

If the customer want conditional coloring of rows based on some conditions, as developers didn’t had the functionality support from the earlier versions of Dynamics NAV Role-Tailored Client.

With the new versions of Dynamics NAV, this was allowed and was able to change the color of the text depending on the predefined conditions. Even though the functionality was allowed, still have limitations for the formatting. Such as, the number of colors support to this functionality is fixed.

Following is a sample for the styled text page in the Dynamics NAV 2013 R2

Sample of Styled Page in Dynamics NAV

Formatting is done by using a property value for style on a field and setting it to a pre-defined value.
Go to the design view of a page and select a field that you want to change the color and then go to the properties of the field.
(Design Page -> Property of the Field want to change the color)
As you see ‘StyleExpr” was already set to “FALSE” and system will show the value in default manner.

To modify the style follow the following steps,
1. Design the page
2. Define a global variable of type text ( StyleText Text 20 )
3. Assign the Style Code value to defined variable in the “OnAfterGerRecord” trigger depending on the condition.

Following is a sample code.

4. Then go to the property of the field and scroll down to the bottom of the property page and assign the variable to the “StyleExpr”

5. Compile and Run the page. (Following is the final output – web client)

Thank You and Best Regards

Tharanga Chandrasekara

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Skip to comment form

  1. This is very Helpful. Thanks for Posting.


    • Unknown on February 26, 2015 at 9:50 am

    Thank you for the response.

  2. I am addicted to Conditional Formating in Excel so is very good to have it ERP as well!!!

  3. Glad it helped you.

  4. Hi Tharanga, Have you done this styling in Matrix Pages, Please share your view on this. Regards Thiyagu

    • Unknown on July 20, 2017 at 10:56 pm

    IF "Unit of Measure Code" = "Unit of Measure Code":: PC THEN BEGIN
    StyleText:= 'Favorable';
    StyleText:= 'StrongAccent';

    i am trying to change font for specific UOM PC but it throws error for "::PC".. how should i fix this

  5. "Unit of Measure Code" is not a option field and therefore you do not need to use the syntax like "Unit of Measure Code" = "Unit of Measure Code"::PC

    You can directly use
    IF "Unit of Measure Code" = 'PC' THEN BEGIN

Comments have been disabled.