Change Background color in grid cell

Hi,

I am having a nightmare trying to get the background colour of a grid cell to change. I have this code in the onrecord event: -

$Color = {Progress_Colour};
if (!is_null($Color))
{
sc_field_style({Progress_Status}, $Color,’’);

}

The color is stored in another field on the table as the colors are variable . The above simply does not work. I know the color is correct. If I hard code the color to #FF0000 in the code it works. I know that indicates that maybe the color variable is’nt picking up anything but it is because I display it in the grid

What’s frustrating is that I have used the exact same in another grid and it works: -

$color_var = {EXP_Colour}; // Green
sc_field_style({EXP_Colour}, $Color_var, ‘’);

You need to use the color directly or with a global variable []