Tuesday, August 19, 2014

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

5 comments:

  1. This is very Helpful. Thanks for Posting.

    Darshana

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

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

      Delete