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:
Microosft Dynamics NAV 2017
Define the variable, and then set the DataType to Boolean.
6. On the trigger OnAfterGetRecord, 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.