sc macro show/hide fields: more fields at once

hi there,

here is a tipp. i just found out that you can show / hide more than one field at once.

using



$myfieldname = "field123";

$this->nmgp_cmp_hidden["$myfieldname"] = "off"; $this->NM_ajax_info['fieldDisplay']['$myfieldname'] = 'off';

instead of the original sc_field_display-macro gives you the possibility to have the names of the fields in a variable and use this variable to show/hide.
you also can use an array and hide the fields with for each.

$allmyfields= = array("name", "field2", "field2", "mytelefone", "ilikefields", "allyourbasearebelongtous", "kensentme", "fieldmustbehidden");

when your have a lot of fields with the same name and just one additional number, like name1, name2, name3, name4 you can EVEN use it like this:

for ($a=1;$a<30;$a++)
	{
 $this->nmgp_cmp_hidden["vlt".$a] = "off"; $this->NM_ajax_info['fieldDisplay']['vlt".$a'] = 'off';
 $this->nmgp_cmp_hidden["vla".$a] = "off"; $this->NM_ajax_info['fieldDisplay']['vla".$a'] = 'off';
 $this->nmgp_cmp_hidden["lab".$a] = "off"; $this->NM_ajax_info['fieldDisplay']['lab".$a'] = 'off';

	
	}

hiding 90 fields at once.

note that this code works with sc6. i dont know if it works with sc7.

This is awesome thank you!

Any chance someone knows if there’s a list of the fields in a control app in a variable or array already? Like some Scriptcase specific array that would contain every field you custom created in a control app.
Thanks!