Column Values Method

Hi All,I am trying to get a ColumnValue in a document choosen by a pick list.The error message I get is:“Variant does not contain a container”.

Following is my code:

Dim empDoc As NotesDocument

Dim nbr As Variant

'getMsg method specifies vw to get pick list

Set dc =getMsg(“smPlcSelectDefinedFor”)

If dc.Count = 0 Then Exit Sub



If dc.Count > 1 Then

	getMsg("smSelectOneDoc")

	Exit Sub

End If



Set empDoc = dc.GetFirstDocument



If Not (empDoc Is Nothing) Then

	nbr = empDoc.ColumnValues(1)

	Messagebox(nbr)

	'doc.defdForDT = empDoc.ColumnValues(0)

	

	'doc.empNmbrMT = empDoc.empNbrMT(0)

End If

Call uidoc.Refresh

The variant nbr is suppose to return the value of the second column from the document that the user has selcted from the PickList and the user can select only one document.

The column in the view whose value I want is evaluated by a formula.I get to the point when the pick list shows up and I select a doc but when I hit ok it says the message I mentioned above.I am assigning the value in the column to a field in the uidoc.

I would appreciate your help.

Thanks,

Sreeni.

Subject: RE: Column Values Method

NotesDocument objects don’t always have a value in their columnvalues property. It depends how you got the document. If your code obtained the document by scanning a view, then it sohuld have columnvalues from the columns in that view. If the documents are selected by the user in a pick list – well, I haven’t tried it, but if that’s what you’re doing, apparently the columnvalues aren’t available then.

You will have to find some other way to find this column value – either use Evaluate and duplicate the column formula in your code, or search for the document in the view to read the other columns.

If you’re using picklist, you can return the value of a view column instead of the document collection. It can be a hidden column, so it can include all the values you needed from other columns as well as the document universal ID (use @Text(@DocumentUniqueID).