Can you calculate Subform using the output of WebQueryOpen agent?

Hello Domino experts,

I have written a WebQueryOpen agent, which will do some calculation when form (A) is opened, and the agent puts a value into the DocumentContext field (F) which is used to choose which subform to display (A1, A2, A3…).

It appears however, the order of events are not in my favour, in that the field value on (F) is set AFTER the form (A) has already calculated which subform to load. Is that true?

If what I want cannot be achieved using this approach, do you have any other suggestions?

I have read one solution on this forum where you do the ‘hiding’ using JavaScript on ‘onLoad’ event using

tags - but I’d prefer not sending unnecessary contents at all from the server side.

I’d very much appreciate your help.

Regards,

Jihong

Subject: Can you calculate Subform using the output of WebQueryOpen agent?

My guess is that subforms are initialized during the time when the form itself initializes, since these become part of the form on open - and that happens before QueryOpen.

A WebQueryOpen event runs the agent before Domino converts a document to HTML and sends it to the browser. So by then the form is fully initialized - after the Notes QueryOpen.