How to blink sc_field_style?

Hello All,

I want to blink one of sc_field_style I’m using can you please help ?
For example I want to blink this row … sc_field_style({MACH}, “#DFFF00”);

if({DAUER} < “10”)
{
sc_field_style({MACH}, “#DFFF00”);
sc_field_style({Status}, “#DFFF00”);
sc_field_style({Duration}, “#DFFF00”);
sc_field_color ({MACH}, “#C0392B”);
sc_field_color ({Status}, “#C0392B”);
sc_field_color ({Duration}, “#C0392B”);

}

What do you mean with ‘to blink’ ?
Do you want to rapidly switch on and off the field background ?
If so I would reccomend to use javascript rather than a SC macro.

Yes I am trying to do exactly what you said. I tried in Java but without success. Can you share a sample code for me according to the above logic.

Put this code in onApplicationInit

?>
<style>
    .blink {
    	animation: blinker 2s linear infinite;
		font-weight: bold;
    }
    @keyframes blinker {
        50% {
        opacity: 0;
    }
</style>
<?php

Configure the style the way you want it

And add this code in onRecord

?>
<script>
	$(document).ready(function(){
	        $("[id^=id_sc_field_MACH]").addClass("blink");
            $("[id^=id_sc_field_Status]").addClass("blink");
            $("[id^=id_sc_field_Duration]").addClass("blink");
	});
</script>
<?php

It should work with grid and form

Hi, I did it following your instructions. But I didn’t get any reaction when I preview.

Sorry, I forgot that the name of the fields are converted to lower case by Scriptcase in HTML

Try this instead

?>
<script>
	$(document).ready(function(){
	        $("[id^=id_sc_field_mach]").addClass("blink");
            $("[id^=id_sc_field_status]").addClass("blink");
            $("[id^=id_sc_field_duration]").addClass("blink");
	});
</script>
<?php
2 Likes

I don’t know how to thank you. You were very helpful and I solved it thanks to you. I wish you a good year.

1 Like

I believe this puts a ‘blink’ on the content of a field (entire column in a grid).
Has anyone tried to set the blink on or off conditionally at the record level ?