Editable checkbox with computed formula

This is a re-post with some new findings. Thanks to those who contributed to my thread on 9 Jan:(https://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/5476050565f4c697852570f1004ff2e0?OpenDocument)

Here is the scheme:

An ‘editable’ checkbox: the list items (dafault is empty) are populated via a dblookup that computes after a user has made a (previous) selection from a listbox above. The checkbox list formula is then computed and populated, with all items selected by default - but remains editable such that items may be de-selected if necessary. Finally, if items are deselected, we need to maintain visibility of all items, both selected and deselected.

Here’s the current set-up:

  1. a computed checkbox field (hidden) with a (the same as above) dblookup in the choices formula - because its computed, all values return as selected.

  2. a flag field (hidden) which determines if anything has been deselected from the editable field below)

  3. an editable checkbox which has the formula:

@if(flagfield = “”; computedcheckbox; editablecheckbox)

This gets almost there. The editable checkbox computes with everything selected by default. If anything is deselected, the flag field gets flagged. BUT now, if something is deselected from the checkbox, when the doc is refreshed, the list is truncated by the deselected items and we lose the visibility of the deselected items.

Is there enough info here to make a determination of where I can go with this?

I would appreciate anyone who has input to this.

Subject: editable checkbox with computed formula

It’s a long time I do not come here!

First, need to make your question clear: you want to compose a new document with all items in editablechecklist selected. If it is right, we can continue.

To do that, you cannot use @dbcolumn/@dblookup in the default value of this field (Lotus Script said that :)). So, you must use a similar second checklist field, but hide it. Is it right ?

There is a solution to solve that:

  1. Make a new document from code:

    set newdoc = db.creatdocument

    newdoc.form = “(Your Form)”

  2. Set the value of editablechecklist item by:

    newdoc.editablechecklist = evaluate(“@dbcolumn(…)”)

  3. call ws.editdocument(false, newdoc, true) (or call ws.editdocument(true, newdoc,false). I did not work with Lotus Script a long time ago)

Good luck

nhatnamnv@yahoo.com