Fields reloaded/calculated incorrectly, after changes made by WebQuerySave agent (worked on R5, doesn't work on R7)

We have a web application, where the document has WebQuerySave agent(s) change a couple of fields there.Some of the fields are necessary for the document to work properly (e.g. store info about the attachments).

When the document is first opened, all the fields are computed correctly. But after saving the document, it reloads with incorrect values in fields.

It worked pretty well on R5, but on R7 we are encountering problems.

I tried it with almost empty form too, and was able to reproduce the bugs so it is not the problem with that specific form. There is something wrong with the way how LN 7 recalculates/reloads fields after save on web.

Use cases:

  1. Field A (hidden) is changed in backend via WQS, field B (computed for display) which uses value of field A in its formula do not show any value at all after reload.

Interesting: when I created Computed text with the same formula, it calculated correctly after save/reload. Yes I know Computed texts evaluate AFTER all the fields and stuff…

Yes and after close/reopen it works fine.

  1. Field A with a default value (can be Editable or Computed) is deleted from document in WQS. After reload, expected behaviour would be that the field gets recalculated with the default value anew because it is in the form design. But no, the field is not there after save/reload. But after close/reopen it is there with correct value.

Can anybody here explain what exactly happens if you save and reload document on web, in R7?

The scenario we use is this: a button with @Command([FileSave]), a WQS agent, lots of various fields of various types, and a bit of Javascript here and there (onload, onsubmit, etc.)

Subject: Fields reloaded/calculated incorrectly, after changes made by WebQuerySave agent (worked on R5, doesn’t work on R7)

Without knowing at least the relevant parts of your code in more detail, this is hard to tell. There is no general issue with WQS agents in Domino 7, if this is what you suspected. But there are a lot of differences between LotusScript 4 (as used in Domino 7) and LotusScript 7 (as used in Domino 7).

Do you use a $$Return field? Does the JS modify field values onload, too?

Subject: RE: Fields reloaded/calculated incorrectly, after changes made by WebQuerySave agent (worked on R5, doesn’t work on R7)

As I mentioned, I tested in with almost empty form too. No $$Return field, no JavaScript there.

Subject: RE: Fields reloaded/calculated incorrectly, after changes made by WebQuerySave agent (worked on R5, doesn’t work on R7)

Post code.

Subject: RE: Fields reloaded/calculated incorrectly, after changes made by WebQuerySave agent (worked on R5, doesn’t work on R7)

Since you have your mail in the profile, I sent you very simple demo database.

One view (the default one)

One form with three fields:

  1. TBM (to be modified) - editable. Its value is incremented by WQS agent each time it runs. Default is “Counter=1”, and it goes like Counter=2, Counter=3 etc.

  2. CFD (computed for display, value based on TBM)

  3. TBD (to be deleted). Editable field with default value. It gets removed by WQS agent.

One agent, called in WQS of that form:

Sub Initialize

%REM

test agent to check what happens after WQS agent on web with specific fields

%END REM

Dim session As New NotesSession

Dim doc As NotesDocument

Dim counter As Integer

Set doc = session.DocumentContext



'we will delete an editable field with default value

'to check if it will be reloaded with a value later

Call doc.RemoveItem("TBD")



'we will modify an editable field that is used in formula of other CFD field,

'to check what happens to the CFD field

counter = Cint(Strright(doc.TBM(0),"=")) + 1

doc.TBM = "Counter=" + Cstr(counter)



'we will add a small invisible field just to see if this went through

doc.AgentRun = Cstr(Now)

End Sub

Oh and don’t be surprised by very strange signatures, I have a wierd domain/usernames on my home machine:)

Thanks a bunch

Darina Sadovska

Subject: RE: Fields reloaded/calculated incorrectly, after changes made by WebQuerySave agent (worked on R5, doesn’t work on R7)

Just a quick reply so far: I’d be lying, if I said that this is exactly what I had expected.

I don’t know, what irritates me more, the fact that it doesn’t act like I would have expected, or the fact that it never was a problem in my applications …

Subject: RE: Fields reloaded/calculated incorrectly, after changes made by WebQuerySave agent (worked on R5, doesn’t work on R7)

After some more tweaking it seems, like adding a computed for display $$Return field with a formula of

“[/” + @WebDbName + “/View/” + @Text(@DocumentUniqueID) + “?EditDocument]”

at least makes the form act as you want to, if you add an @Command([CloseWindow]) to the Save button. Most of my apps do make use of $$Return fields or the equivalent in WQS agents, but not necessarily in the same environment. Still a little puzzled …