Sc_block_display not working in advanced search v8.1

Hello. The following SC macro does not seem to work when I substitute my search block names. Here is the basic macro:

sc_block_display(Block_Name, on/off)
Dynamically determines the display fields of a specific block.

By default all the blocks are displayed (“on” condition).

Ex. 1:
if ({type_customeri} == “personal”)
{
sc_block_display(company, off);
}
else
{
sc_block_display(personal, off);
}

Here is my code which I’ve tried at both grid scriptinit and advanced search scriptinit. Emotions and Part 2 are the names of the blocks in my advanced search. I’ve also tried with just the Emotions block. The macro has no effect.

[glo_simple] = 1;

if ([glo_simple] == 1)
{
sc_block_display(Emotions, off);
sc_block_display(Part 2, off);
}

Has anyone had success with this macro?

Thank you!

try off in quotes “off” and check where you fire this code

Blocks have both a name and a label and they can be different.
Are you sure you’re using the names of the blocks in the macro?

Thank you. Yes, using the names.

Thank you. I tried with the quotes and at events scripinit in both grid and search and also applicationinit in grid.

what also is possible is that he does’nt reset the blocks try

if ({type_customeri} == “personal”)
{
sc_block_display(company, “off”);
sc_block_display(personal, “on”);
}
else
{
sc_block_display(personal, “off”);
sc_block_display(company, “on”);
}

Thank you. Also doesn’t work. Baffling.

This is my code following example:

[glo_simple] = 1;

if ([glo_simple] == 1)
{
sc_block_display(Emotions, “off”);

}
else
{
sc_block_display(Emotions, “on”);
}

if you lose the IF code does the block appear or disappear?

Good idea, but still displays. Here is the code that I’ve tried placing at the grid events scriptinit, applicationinit, and advanced search at scriptinit.

sc_block_display(Emotions, “off”);

I tried changing the Emotion block setting to Start Closed, and that worked.

Here are the blocks: