InviewEdit and value form a keyword

Hi,

could someone tell me how to display the values from a keywordlist in a field edited in a view (with the property edit column value). I hope it’s possible as it will help me

Thanks

Willette Jean-Michel

Subject: InviewEdit and value form a keyword

You must write a handler for the QUERY_REQUEST event that queries the user for their selection using NotesUIWorkspace.Prompt (or dialogbox if that works better for you). Whatever value they select, update that into the field value you were passed and tell Notes not to let them edit the field (unless you want to let them type non-keyword values also).

Incidentally – search before you post. This has already been discussed.

Subject: RE: InviewEdit and value form a keyword

Andre thanks for the advise but I still have a problem,

when I select the value from the prompt, I want to put it in the columnvalue(0) (It works I see the value in the debugger ) but in the display Notes shows me the input field and if I want to move to the next field I didn’t see my selected value but a blank

Here is the code

What I want to do is give the possibility to the users to create a document from the view interface (there are only 2 fields)

Sub Inviewedit(Source As Notesuiview, Requesttype As Integer, Colprogname As Variant, Columnvalue As Variant, Continue As Variant)

Dim caret As String

Dim values() As String

Set s = New notessession

Set ws = New NotesUIWorkspace

Stop

REM Get the CaretNoteID - exit if it does not point at a document

’ caret = Source.CaretNoteID

Set db = s.CurrentDatabase

If doc Is Nothing Then

	Set doc = db.CreateDocument()

	doc.form = "Disposition"

End If

REM Get the current database and document

’ Set db = Source.View.Parent

’ Set doc = db.GetDocumentByID(caret)

REM Select the request type

Select Case Requesttype

Case 1

	If colprogname(0) = "Disposition" Then

		Redim Preserve values(3)

		values(0) = "En U"

		values(1) = "Théatre"

		values(2) = "Ecole"

		values(3) = "Autre"

		tmpdispo= ws.Prompt(PROMPT_OKCANCELLIST,"SELECT","Select a disposition","",values)

		columnvalue(0) = tmpdispo ' I WANT TO DISPLAY THE VALUE FROM THE PROMPT IN THE VIEW

		

	End If

	

Case 2

	columnvalue(0) = tmpdispo

	Call doc.ReplaceItemValue(columnvalue(0),tmpdispo)

’ Call doc.Save(True,False)

Case 3

	Print "passage dans le case 3"

Case 4

	

	x = 0

	Forall y In colprogname

		Call doc.ReplaceItemValue(y,columnvalue(x))

		x = x+1			

	End Forall

%REM

If Ubound(columnvalue) = 0  Then

		If colprogname(0) = "Disposition" Then

			If columnvalue(0) <> " " Then

				tmpdispo = columnvalue(0)

			End If

		Else

			If columnvalue(0) <> " " Then

				tmpnbr = columnvalue(0)

			End If

		End If

		Exit Sub

	End If

%END REM

	Msgbox columnvalue(0)

	Msgbox columnvalue(1)	

	Call doc.ReplaceItemValue("Form", "Disposition")

’ Call doc.ReplaceItemValue(“Disposition”, tmpdispo)

’ Call doc.ReplaceItemValue(“NbrPlace”, tmpnbr)

REM Save(force, createResponse, markRead)

	Call doc.Save(True, False, True)

End Select

End Sub

Subject: RE: InviewEdit and value form a keyword

You probably need to set Continue=False in case 1, in the case where QUERY_REQUEST assigns the columnvalue. Please let us know whether that works.

Subject: SOLUTION: InviewEdit and Keyword List

This solution will allow for a keyword box to appear, rather than editing the column directly with free-form text. After the selection is made, and the “OK” button is clicked, the column will be updated without the highlighting the column value.

REM Select the request type

Select Case Requesttype

Case 1

If colprogname(0) = “Disposition” Then

Redim Preserve values(3)

values(0) = “En U”

values(1) = “Théatre”

values(2) = “Ecole”

values(3) = “Autre”

tmpdispo= ws.Prompt(PROMPT_OKCANCELLIST,“SELECT”,“Select either Key Account or nothing”,“”,values)

Call doc.ReplaceItemValue(“Disposition” ,tmpdispo)

Call doc.Save(True, False, True) 'Save must be perfromed here, or data will be lost.

Continue=False 'Keeps the column from being editable.

Call ws.ViewRefresh 'Refresh the view.

End If

Case 2

Hope this helps,

Scott

http://www.cycom-inc.com

SEARCH KEYWORDS: InviewEdit, Keyword List, Prompt, Dialogbox

Subject: RE: InviewEdit and value form a keyword

Andre,

This has been discussed, but I haven’t found one post with a viable solution.

If these solutions exist, can you provide the link to this threads?

Thanks,

Scott

www.cycom-inc.com