Set Checkbox with Lotus Script?

I have an agent used to display a group of documents, each one containing a checkbox field which is named using the Doc ID, to indicate if the status of the item (if checked the item in the list is complete).

How do I take the value being generated from the doc.Request_Content(0):

076EB63C66F170D6A325701800535C1A=on

and use it to set an actual lotus checkbox field on the underlying document?

I tried to use:

doc.Status = True

but this doesn’t seem to work.

Any ideas or suggestions would be greatly appreciated - thanks in advance.

Subject: Set Checkbox with Lotus Script?

I suspect you don’t have the underlying document just yet. All the web form passes you is a bunch of field-value pairs, where some of the fields just happen to be the UNIDs of documents, not the documents themselves. What you’ll need to do is to parse out the fields submitted from your form, loop through them, see if you can get a document with the UNID matching the field name, and if so, only then try to set the value of the status field.

Subject: RE: Set Checkbox with Lotus Script?

Correct - once I have the document ID, I access that document using my view.

I am setting a field called comments and then saving the document:

Set doc = db.GetDocumentByUNID(Cstr(sDocID))

'doc.Status = True

doc.Comments = sComments

Call doc.Save(True,True)

So I know that I am access the correct document, my problem is the syntax for checking/unchecking the Status checkbox. I tried to set it to True, “on”, “1”, but none of these worked.

Haven’t been able to find much in help or here so far, any suggestions?

Subject: RE: Set Checkbox with Lotus Script?

Ah, I see. The problem here is that in Notes, you should never think of a box being checked. Always think of a field having a certain value or values. Checking boxes is merely a way of indicating which of the potential values are selected. Go to the form used for these documents, find the Status field, get its properties, and see what the choices are. That’ll tell you what you should set doc.Status to.

Subject: RE: Set Checkbox with Lotus Script?

You’ll need to set whatever the value is in the checkbox field widget (the choices list). The back-end document doesn’t know about checked and unchecked fields, it only knows “” or some other item value (probably “Completed” or some such).

Subject: RE: Set Checkbox with Lotus Script?

Thanks!