Go to Scriptcase store

# onRecord - Grid
View video

This event occurs immediately before printing a row.

This event is executed immediately before the display of each record displayed in the query, regardless of user interaction.

Thus, it is commonly used for data manipulation and validation, creating links with the `sc_link` macro or changing the layout with the `sc_field_style` macro, based on the displayed information.

In the example below, the style of the text in the `{priceorder}` field will change according to the value.

For values below 500 reais, the text will have a different color from values above 500 reais,

Samples Code

`if ( {priceorder} < 500 ) {`

`````sc_field_style({priceorder}, "Background-Color", "15", "#228B22", "", "bold");
`

`} else {
`

`sc_field_style({priceorder}, "Background-Color", "15", "#006400", "", "bold");
`

`}`