GRID BUG in sc_field_color and sc_field_style functions

SOLVED ! Hi Friends,
as a registered customer I’m not able to send in a BUG to the NetMake’s ticketing directly (WHAT ???), so I write it here, please check if it is only for me or a general bug:
I want to colorize grid fields based with database field values, color values are stored correctly in a db field. Actual documentation of sc_field_color and sc_field_style macros tells (with examples) that it is possible to use variables as parameter for these functions (not only direct color codes).
If I use

sc_field_color("FieldName", "red");

or

sc_field_color("FieldName", "#FFF000");

both version work well.
If I use

sc_field_color("FieldName1", "FieldName2"); 

or

sc_field_color("FieldName1", {FieldName2});

none of them work. The generated html shows the

"<div style=background-color:fieldname2;" 

tag for the element.
If it is experienced by others, please inform the company about the error.
Br
zsimre

and what what type of field is your {fieldname2} did you find something called “html color”?

did you try sc_field_color(“FieldName1”, “{FieldName2}”);
or
sc_field_color(“FieldName1”, [FieldName2]);
or
sc_field_color(“FieldName1”, FieldName2);
or
sc_field_color(“FieldName1”, “#{FieldName2}”);

in which event you are putting that? onRecord? grid+onRecord, otherwise it will not work… also is your fieldname2 defined? did you try as global instead and try to add it manually when grid start?
I guess it is not related to sc

Thanks MikeDE,
what i did is simple to use the manual’s examples…(with my fields)

Of course the fieldname2 is a database field, content filled with the query assigned to the grid, db field type is varchar(10)

[QUOTE=MikeDE;34206]in which event you are putting that? onRecord? grid+onRecord, otherwise it will not work… also is your fieldname2 defined? did you try as global instead and try to add it manually when grid start?
I guess it is not related to sc[/QUOTE]

Yes, it is called in onRecord event. I’ll try your proposed solutions, than i’ll provide rerults

there is field type called “html Color” have a look

Hi MikeDE, in my version (8.00.0029) there is no html Color field type , only similar is “html Image” what is available. On database level (mysql 5.5) also not “html Color” field type.
If you try the sc_field_style function on grid:onRecord, it works stupidly: in final rendered html the element background color tag will be exactly the string with small cases (!!!) what you assigned in the calling function…

and yesss !!!
the winner is:

MikeDE, BIG THANKS !!!

glad it helped

you should also have a look at html color dude
it is there when you use form entry field
see how it will be saved to db
user will have power to select color from a nice color palette :smiley:

cheers