Problem when using Prompt and Picklistcollection, Help please!

Hi,I am using prompt and picklistcollection in my lotusscript codes as follows:


flag1 = workspace.Prompt( PROMPT_OKCANCELEDITCOMBO, “test1”, “PrepayInvStr2”, temp(0) , temp )

Set Picklist = workspace.PickListCollection(PICKLIST_CUSTOM,True,CurDb.server,CurDb.filepath,COMLINESTR, “commitmentLineStr”, “selectCommitmentLineToPayStr”,“”)


I got “Cannot execute specific command” LotusNotes message with the Picklist window openning, it is very annoying. I used debug, but I can not find any problem on the codes, just that message popup when picklist window openning.

The thing is I need the prompt window for user to input data and then use it on the second picklist window. But if I hardcode the flag1 return data which do not use prompt, no problems. But I need prompt to accept user input.

It seems Prompt can not be used with picklist window?

thanks a lot for any help

Subject: Problem when using Prompt and Picklistcollection, Help please!

I don’t see how you have used Flag1 in calling the PickListCollection. But if you can hard code a value for Flag1 but can not get it from the prompt then this should be the first clue that perhaps the value the Prompt passes to Flag1 one is wrong. What is the Data Type for Flag1? Is it defined explicitly Dim Flag1 as String? What do you do with the value for Flag1?

Subject: RE: Problem when using Prompt and Picklistcollection, Help please!

Hi Bill,thanks a lot for your response so quick.

there are some lines of codes between flag1 and picklist, but let’s make is simple, I have created a simple following codes with a click button which can simulate that problem.

CurDb.title = “ITEC 2005”

So Temp(0)=“2005”

 Temp(1)="2004"

 .....

You will get that error after you click button to let the Prompt popup first, then click OK, then the error message will popup with the picklist window.

And ideas?


Sub Click(Source As Button)

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim PrepayInvStr1 As String

Dim PrepayInvStr2 As String

Dim temp(4)

Dim CurDb As notesdatabase

Dim flag1 As Integer

Dim Picklist As notesdocumentcollection

Set CurDb=session.CurrentDatabase

Dim COMLINESTR As String

COMLINESTR="AccruedInvoices"

temp(0)=Right(CurDb.title,4) 

temp(1) =Cstr(Cint(Right(CurDb.title,4)) -1)

flag1 = workspace.Prompt( PROMPT_OKCANCELEDITCOMBO, "test1", "PrepayInvStr2", temp(0) , temp )

Set Picklist = workspace.PickListCollection(PICKLIST_CUSTOM,True,CurDb.server,CurDb.filepath,COMLINESTR, "commitmentLineStr", "selectCommitmentLineToPayStr","")

End Sub

Subject: RE: Problem when using Prompt and Picklistcollection, Help please!

I just copied your code, and created a view of name “AccruedInvoices” and I didn’t get any error message.

First got the picklist with 2005, 2004 as the choices.

Selected 2005.

Then the Dialog box came up with a list of documents. I selected one and clicked on OK.

No error.

My best guess is you don’t have a view called “AccruedInvoices” or more than one view with that name.

Subject: RE: Problem when using Prompt and Picklistcollection, Help please!

Hi Stephen,Thank you so much for the help,

Yes, you are right, the problem is the AccruedInvoices view.

I have formula “@Command([ViewExpandAll])” in the queryopen event of that view.

It is OK after I remove that formula.

But the thing is that the view with that formula in the picklist window has been used for 3 years without problem. just I want to add more codes with the prompt, the problem happened. Weird.

Anyway, thanks again for your help,