Link to home
Start Free TrialLog in
Avatar of Zenoe
Zenoe

asked on

ComposeDocument not working on R5

I have a form (that will not be saved - saveoptions field set to 0). This form has a button that should open a new form and then paste certain values into fields on this new form. Here is part of my code on this button:
                Dim workspace As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument      
      Set uidoc = workspace.CurrentDocument
                Call uidoc.GoToField( "CoName" )
      Call uidoc.SelectAll
      Call uidoc.Copy
      Call uidoc.Close
      Set uidoc = workspace.ComposeDocument("","","MyNewForm")
      Call uidoc.GotoField("Company")
      Call uidoc.Paste

I am working in Domino 6. The code is working perfectly on the Notes6 Client, but gives an error on the Notes 5 client. Everything works except the ComposeDocument part. I get an error: "Invalid Formula: unknown function/operator" and when clicked OK: "Unable to find document Window".

I don't want to fiddle too much with the rest of the code, because there are all kinds of other things that are dependent on the copy and pasting, etc. Any help would be appreciated, as this is getting quite urgent and my launch date is around the corner.

THANKS!!
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HemanthaKumar
HemanthaKumar

There is a timing issue that has always been associated with compose command in R6 and R5.. the tab window behaviour are little different in both versions.. Sjef version should work as you don't involve two uidocs in a sequence...

Or other soln is to compose document in queryclose event of the form...For that you have to mention that it need to compose doc by setting some global variable.

~Hemanth
Avatar of Zenoe

ASKER

Thanks guys. It turns out that my problem was actually associated with the new form I was opening. This form had one field on it that called a function new to R6 - thus the error. I found Sjef's answer very helpfull though, and will award the points to him.
"Award" and "with a C" are in EE an oxymoron. Might I suggest to ask for a PAQ/Refund (in Community Support) next time when you find the answer yourself? That won't hurt my feelings as much...

Sjef ;)