Ws.prompt problem

Hi,I had allready asked this but some change in the functionality thats why asking agaikn…

I have ws.prompt functionality in the code from which user will select rejection reasons…in this the user should be able to view/edit the choices present in the list and also able to add new choices…

I cant use ws.dialog method because the return value from ws.prompt is a string and ws.dialog returns a boolean…the string value from ws.prompt is required after wards…

how to do this??

Subject: ws.prompt problem

post the code you have so far

Subject: RE: ws.prompt problem

Code:

'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

’ PROMPT USER TO SELECT A REJECT REASON

'--------------------------------------------------------------------------------------------------------------------------------------------------------------------

'Dim askme As Variant

'Dim requestdenied As String

'

'reason(0) = "Documentation Error(s)"

'reason(1) = "Not Needed"

'reason(2) = "Logic Error(s)"

'reason(3) = "Platform Related Issue"

'reason(4) = "Rescheduled"	

'reason(5) = "Requirements Change"

'reason(6) = "Other - See Rejection Comments"



'askme = ws.Prompt(PROMPT_OKCANCELLISTMULT, _

'"Select A Reason", _

'"Select A Reason For Rejecting This Document", _

'reason(6), reason)

askme=ws.DialogBox("RejectionReason",True,True,False,False,False,"Rejection Comments")

'if askme contains "other...." then call up the RejectDialog box form to add additional information and append it to the additional information field

Forall m In askme

	If m = ("Other - See Rejection Comments")  Then

		Msgbox"Please Enter your comments in the below field"

		additionalinfo = ws.Dialogbox("RejectDialog",True,True,False,False,False,False,"Rejection Comments",)

	End If

End Forall





If askme=False Then

	Messagebox "Sorry, you must select a reason for rejecting this request", , "Reason Required"

	Exit Sub

Else

	Forall ask In askme

		asklist = asklist & ask & Chr(10)

	End Forall		

	

End If

'put the reject reasons in the rejectreason field to be used in views

Set item = doc.GetFirstItem( "RejectReason" )

Call item.AppendToTextList(Cstr(asklist))  



' add the reject reasons to the Approval History	

Set item = doc.GetFirstItem( "ApprovalHistory" )	

Call item.AppendToTextList( "Version " + Cstr(uidoc.FieldGetText("DispVersionNumberRework")) + " Reason(s) Rejected:  " & Cstr(asklist))

'------------------------------------------------------------------------------------------------------------------------------------------------

’ PROMPT FOR ADDITIONAL INFORMATION

'------------------------------------------------------------------------------------------------------------------------------------------------

'Input box to get additional information

'additionalinfo = Inputbox$("Add any additional information here", "Additional Information")

'-------------------------------------------------------------------------------------------------------------------------------------------------------

’ CONFIRM REJECT

'-------------------------------------------------------------------------------------------------------------------------------------------------------

'confirmmsg% = Msgbox ("Test: last chance to cancel out of this - test  Do you wish to continue?" , 4+ 32 + 0 + 0, " Transmission")

confirmmsg% = Msgbox ("This will reject this LCN and send a notice to all the participants.  Do you wish to continue?" , 4+ 32 + 0 + 0, " Transmission")

If Not confirmmsg = 6 Then

	Exit Sub

End If

This is the code…now this code has only 6 options which are const…i want those options to be editable…also user should be able to add new options…the 6 options one can see r Documentation Error(s),LCN Not Needed and so on…

Subject: RE: ws.prompt problem

thought you wanted to use the Prompt method. Why not use PROMPT_OKCANCELEDITCOMBO, this will allow user to select an existing value from a list or type in their own value.

Dim ws As New NotesUIWorkspace

Dim askme As Variant

Dim reason (1 To 6) As String

reason(1) = "Not Needed"

reason(2) = "Logic Error(s)"

reason(3) = "Platform Related Issue"

reason(4) = "Rescheduled" 

reason(5) = "Requirements Change"

reason(6) = "Other - See Rejection Comments" 

askme = ws.Prompt(PROMPT_OKCANCELEDITCOMBO, "Select A Reason", "Select A Reason For Rejecting This Document", reason(6), reason)

Subject: RE: ws.prompt problem

Well!! This is working…but the problem is I want user to select multiple values as rejection reasons can be multiple…and by this method user can select one value and if he wants to select one more value then he will have to type it and if user gets wrong in the spelling of the rejection reason then the caode won’t be executed as per the requirement…

I dont think anything more can be done about this…Please let me know if something more is possible…

nyways…thanks for the help…at least because of your suggestion i was able to complete 70% of the work…

Subject: RE: ws.prompt problem

maybe have another choice of “enter new reason” so user can choose:

reason 1

reason 2

enter new reason

then check the values returned and if “enter new reason” is a choice then give them another prompt where they can enter their new choice. I know it’s 2 prompts but maybe this will work for you.

Subject: ws.prompt problem

From the Designer Help…

Variant of type integer	for PROMPT_OK, PROMPT_YESNO, PROMPT_YESNOCANCEL



Variant of type string	for PROMPT_OKCANCELEDIT, PROMPT_OKCANCELLIST, PROMPT_OKCANCELCOMBO, PROMPT_OKCANCELEDITCOMBO, and PROMPT_PASSWORD



Variant Array 	for PROMPT_OKCANCELLISTMULT

Type% PROMPT_OK always returns 1.

For type% PROMPT_YESNO, returns 1 if you press Yes. If you press No, returns 0. For type% PROMPT_YESNOCANCEL, returns -1 if you select Cancel. For all other type%s the return value is a variant containing a string array if you press OK, and EMPTY if you press Cancel.

Subject: RE: ws.prompt problem

I want to provide the facility of editing the list of choices…I mean to say allow user to provide external values. This is present in the dialog list field where one can add additonal extra values not in the field.

Subject: RE: ws.prompt problem

The use a dialog box!!

You can call a Ws.DialogBox using a document other than the active one. Then just get the value from that document

eg: Ws.DialogBox(“(DialogBoxName)”, true, true, false, false, false, false, “Title”, tempDoc)

value=tempDoc.WhateverFieldName(0)