user1912987
user1912987

Reputation: 115

I have to get Lotus notes document by setting 2 combinations as unique

I have to pick a document in lotus notes Using vertical and country as unique. I have used below code which is showing error:

Set vcDoc = vcVw.GetDocumentByKey(empStubDoc.empVertical(0) & empStubDoc.empCountry(0))

My vertical form has following fields;

Vertical, Vertical Head, vertical HR SPOC, Country

Please let me know how can i do that if there is any alternative.

Upvotes: 0

Views: 99

Answers (2)

Knut Herrmann
Knut Herrmann

Reputation: 30960

Assuming, your form has the fields Verticaland Country then your code should be

cDoc = vcVw.GetDocumentByKey(empStubDoc.Vertical(0) & empStubDoc.Country(0), True)

Fieldnames have to be without starting "emp". You get the error because fields "empVertical" and "empCountry" not found in document.

Your view have to have a first sorted column with formula

Vertical + Country

Upvotes: 1

Per Henrik Lausten
Per Henrik Lausten

Reputation: 21709

You are using the variable vcVw to refer to a view. The first view column of this view must contain the exact combination of the fields Vertical and Country and be sorted in order for you to be able to use GetDocumentByKey() with the values empStubDoc.empVertical(0) & empStubDoc.empCountry(0) as lookup key.

Upvotes: 0

Related Questions