I am new to programming. How do I change colors for a row based on a field content.
Example: if type trans field has income row color is Green, else if expense row color is red.
You can change the cakground of the fields like this:
EXTENTION is my field name.
If you do it this way you have to change each field and this is done by adding the code to the OnRecord event.
if ({EXTENTION} < 200)
{
sc_field_style({EXTENTION}, ‘#33FF99’, ‘15px’, ‘#000000’, ‘Arial, sans-serif’, ‘bold’);
}
elseif ({EXTENTION} >= 300 and {EXTENTION} < 400)
{
sc_field_style({EXTENTION}, ‘#779438’, ‘15px’, ‘#000000’, ‘Arial, sans-serif’, ‘bold’);
}
elseif ({EXTENTION} >= 400 and {EXTENTION} < 500)
{
sc_field_style({EXTENTION}, ‘#ff0088’, ‘15px’, ‘#000000’, ‘Arial, sans-serif’, ‘bold’);
}
else
{
sc_field_style({EXTENTION}, ‘#ffff00’, ‘15px’, ‘#000000’, ‘Arial, sans-serif’, ‘bold’);
}