WebQueryOpen and Computed fields

Well finally I am getting a bit more back on the development track. So I might spend some times here with dropping some code.

One of my latest ‘how do I do that?’ challenges was to write values collected by a WQO agent into a Form. 

So how do you do this with computed fields?

Well you get the documentcontext just like you would normally do:

Dim s As New notessession
Dim db As notesdatabase
Set db = s.currentdatabase 
Dim doc As notesdocument
Set doc = s.documentcontext

An editable field you would set in this way:

doc.fieldX = “collected data”

But as expected this will come up as editable value in the field name in the web form. You could att the htmlattribute “type = hidden” but I could navigate to that document via the DOM structure of the page.

If you would avoid that you could try writing to a computed field using these statements:

doc.cfieldX=”collected data”
doc.cfieldXWQO=”collected data””

  • cfieldX is the editable field, set type=”hidden”
  • cfieldXWQO is the computed field, set as computed value ‘cfieldXWQO’.

Note:

If you would save the document via a normal way (@command([FileSave]) or a JS submit() the value in the field cfieldXWQO is not saved. So in order to save the collected data you need to use a WebQuerySave agent…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s