2
votes

Is there a way to hide a column in Lotus Notes if the entire column is empty? I've tried using

@ThisValue = ""

in the column properties, but that causes the column to disappear if atleast one value is null, rather than if all the values are null.

3

3 Answers

2
votes

Put the code to check emptiness of the column into view's QueryOpen handler. Depending on the result of your check set a value (f.e. "0" or "1") to an environment variable:

Call notesSession.SetEnvironmentVar("hidecolumn", "1")

or

@SetEnvironment("hidecolumn"; "1")

And in your column's hide-when formula write @Environment("hidecolumn") = "1"

It works in LN6.x and later.

1
votes

You could try to use @DbColumn. I haven't used/tested it myself, but according to the help, it should work in Hide-When, even if it is not working for column values. So perhaps it does work. I would try that, in combination with @Unique to get just unique values to test against.

0
votes

Better logic would be

!(@Thisvalue != "")

as this will return False if any value is not null, and true only if they all are (as formula language will operate on lists as a default).

However, I've not been able to get this to work in a hide-when formula, even when replacing "@ThisValue" with the column's programmatic name.

My initial reaction to the question was that you wouldn't be able to hide a column in the Notes Client, based on its own values, and after a quick test I'd be surprised and very interested if you manage it.

Phil