Hide empty fields on a form

gustavo1
Kilo Contributor

Hi all,
I'm trying to do something that I don't know if possible, here is what I was requested:
We have a table with a lot of fields and those fields will be populated through a Record Producer, the table will have as well table list and a form, in the form I need to show only the populated fields, those ones that are empty should be hidden.
We will never know what fields will be empty so I was wondering if possible, if so how can I get it?
Thanks in advance for the advices.

7 REPLIES 7

Aaron40
Kilo Guru

If I understand you correctly you have a record producer that people fill out and when they fill out information and submit it, you want the record page to display only fields that have a value?

If that's what you're trying to do, UI policies (one for each field) can be used to check each field for a value and hide it if it's empty.


gustavo1
Kilo Contributor

Correct, that's what I need, I was thinking if possible to run a script instead of select one by one the all the fields, is that possible?


Aaron40
Kilo Guru

Absolutely,

An onload client script can accomplish the same thing. The script would be a whole set of conditions and setvisible's. One client script is probably more manageable than a pile of UI policies, though UI policies typically load faster.

It would look something like



function onLoad() {
if (g_form.getValue('field1') == '')
{
g_form.setDisplay('field1', false);
}
else if (g_form.getValue('field2') == '')
{
g_form.setDisplay('field2', false);
}
}


If this answers your question, please mark this topic as ANSWERED. Thanks!


gustavo1
Kilo Contributor

Both options you gave me are fine, but I'm talking about a table with around 90 fields, most of them are True/False but those are a lot of fields to handle one by one, does is possible to put the field's table in an array or something?