The one causing the "Cannot execute the specific command"is
Set udoc = ws.ComposeDocument(serverName,dbName, “Sales performance dashboard” )
did I set the parameters wrong?
the problem is the code gets executed but it always prompt “Cannot execute the specific command”
Subject: Are you sure the error comes from the agent code?
Or could it be that it is raised by something on the form? I’d check the form’s QueryOpen and PostOpen event, for example.
Subject: I already check QueryOpen and PostOpen
they don’t have anything inside them
Subject: Jochen is right…
queryopen and postopen was just an example of where to look. Now that you tell us that the document actually does get composed, that means the error refers to some other command that’s executed by the form when you open it. Look for @Commands in formulas, or just export the document as text via DXL export, and look through that to see all the code.
Subject: Form exist?
did the Sales performance dashboard form already exist?
Subject: Re: Form exist?
Yes the form is already existing
Subject: Thanks guys for replying and giving advice
The problem was solved but i don’t know how
Subject: did you set the parameters wrong
Maybe; what did you set them to? Use the debugger or put up the values in a messagebox to find out.
Sometimes you get this sort of error because you’re trying to use the command in a situation where it will not work; for instance, you can’t compose a document if there’s a modal dialog open (e.g. from Dialogbox method).
- Andre Guirard, IBM/Lotus Development
Useful blog: Best Practice Makes Perfect
NOTE: My policy is to post only two responses to the same question. So that my second response can solve your problem rather than being a request for details, please read the C R I S P Y document.
Subject: i think i set my parameters right
the command works, it still creates a new document but my problem is that IBM Lotus notes prompt shows up
Subject: What are the values of the variables?
dbName and Server that is.
Also check that the agent has rights to create the document.
Subject: the values of servername and dbname
serverName = ""dbName = “BRANCH.NSF”
i didn’t use an agent
i use a button to trigger the event
Subject: Working for me.
In a test database on local (as Server = “”) I created a sample form called “Sales performance dashboard”
Then created a view button with the following code:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Const serverName = ""
Const dbName = "TEST.NSF"
Set udoc = ws.ComposeDocument(serverName,dbName, "Sales performance dashboard" )
End Sub
Testing the button worked fine. There may be other factors that is blocking your code.