I want a computed subform that defaults to a subform if the computed subform does not exist.
Anyone have a hint or solution? Our server uses domino 7.01.
I want a computed subform that defaults to a subform if the computed subform does not exist.
Anyone have a hint or solution? Our server uses domino 7.01.
Subject: Verify existence of subform
Try a different approach:
On ALL of your valid subforms put a ‘Computed For Display’ field with a data type of ‘Number’ and a Formula of ‘1’, Call the field ‘GoodSubform’.
On your parent form, put 2 computed subforms in a row. The formula for the first subform is the same as what you are currently using. The formula for the 2nd subform should be ‘@If(GoodSubform=1;“”;“DefaultSubform”);’
This will have the effect of displaying ‘DefaultSubform’ only when the other subform is not present. I think thats what your trying to accomplish
Subject: Hmm, sneaky! I like that!
Subject: RE: Verify existence of subform
There is no way to write a formula that directly tests whether a subform exists.
You could do this test with LotusScript code on opening the database and store a value in a profile document. Or, you could always use the same name (“Stuff”), and if you add a subform, rename the old “default” subform to “Old Stuff” and give the new one the name “Stuff”.
You could create a view of design elements – there’s some code for this in the Sandbox somewhere – and use @DbLookup, but I do not advise this approach as it’s hard to maintain.