When using the ComputeWithForm method to add a person to a copy of our Domino Directory (used for registering our customers for access to a secure area of our site) the time to save the document is painfully slow, 1 to 2 minutes.
Removing the Computewithform method results in the process being carried out in less than a second, however the user is not correctly registered and cannot log in. Using Computewithform in other applications (eg to generate an email) is fine. Manually raising a form using the same fields is also fine.
Any suggestions to overcoming the problem would be greatly appreciated.
Dim docPerson As NotesDocument
Dim db As NotesDatabase
Dim success As Variant
Set db = New NotesDatabase("Server Name","database.nsf")
Set docPerson = New NotesDocument ( db )
docPerson.Form = "Person"
docPerson.FirstName = ReqFirstName 'previously obtained from another form
docPerson.LastName = ReqLastName 'previously obtained from another form
etc.......
docPerson.Type = "Person"
success = docPerson.ComputeWithForm(False, False )
If success Then
Call docPerson.Save( True,True )
End If
Subject: ComputeWithForm slow when used on Domino Directory
You could tell the user at registration that it’s an hour or half hour wait and then have a scheduled agent that runs on new documents which runs doc.computewithform to refresh the fields and at the same time send them an email notifying them that their account has been activated, but I’m not sure why your form is taking so long, that’s a little strange.
Subject: RE: ComputeWithForm slow when used on Domino Directory
Thanks Andrew,The script runs from a button click on a user’s client, This is necessary to approve the request. The delay in computing results in the client ‘hanging’ for 90 seconds or so. Picking up on your suggestion, do you think it would be possible to run the Computewithform from an agent on the server which does not ‘tie in’ the client. I do not really wish to wait an hour or so, access to the site is required on registration.
I am new to scripting so sorry if my question is pretty basic.
Subject: RE: ComputeWithForm slow when used on Domino Directory
You could set the agent to run on the event trigger of ‘when document are created or modified’ this way the server executes your refresh and not the client. If the user in anyway clicks a button of triggers an event (eg query save, query close, etc) which executes the code, you’ll be back to the 90 secs again.
Subject: RE: ComputeWithForm slow when used on Domino Directory
To avoid the delay, make it a two-step approach.
-
Create an agent that does the actual computing, and mark it to “Run in a background client thread”.
-
In the button just include the code to call the agent with the ID of the document that should be processed.
When the uses then presses the button, the client will remain responsive and working, while the actual computation happens in the background client thread.
Not the ideal solution, but it is probably far more acceptable for your users.
cheers,
Bram
Subject: ComputeWithForm - many thanks Andrew and Bram
Subject: ComputeWithForm - problem is network related…
… I appear to have wasted peoples time, I have determined that the problem relates to the fact that the server is in a DMZ. Normal notes operation (Replication between servers across the DMZ) is fine. If anyone knows which ports should be open for the script to work correctly then I would appreciate your help.
Subject: RE: ComputeWithForm - problem is network related…
Hi,
The notes port is 1352 TCP.
Daniel
Subject: RE: ComputeWithForm - problem is network related…
Thanks Daniel, we have port 1352 open between the network and the server in the DMZ, it must be something else!