hi,i am fetcing two field value from uidoc , then joining both of these two field value to make a key value… This key value is used to search in the view , i .e document is Available or not against it.
Problem is that , the document is displaying in the view, but i am unable to fetch document against a particular key , when for other key its working fine.
what can be the problem?
is key value has some limitation in character or anything else…
following is my key value(Hard coded for test purposes)—>
key=“FLAT PRODUCT TECHNOLOGY GROUPCUSTOMER COMPLAINTS (HRC)”
key=Fulltrim(key)
value against this key is present in the view, but still unable to fetch the document against it.
Any help will be Appreciable.
Thanks & Regards
Rupesh
Subject: key value limitation?
Post your code, the column formula and column settings.
Subject: RE: key value limitation?
Field Existing Formula →
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim dbkpi, db As NotesDatabase
serv = Evaluate("@Name([Abbreviate];@Subset(@DbName;1))")
Set dbkpi = session.GetDatabase( serv(0), "KPIMAST.NSF")
Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument
Set doc = uidoc.document
Call uidoc.fieldclear("Define_kpi_uom1")
key=Trim((doc.Define_kpi_department1(0))+Trim(doc.Define_kpi_kpi1(0)))
Dim docfirst As NotesDocument
Set view = dbkpi.getview("VSUOM")
Set docfirst = view.getDocumentbykey(key)
If Not docfirst Is Nothing Then
Call uidoc.fieldsettext("Define_kpi_uom1",docfirst.FRMKPI_UOM(0))
Exit Sub
End If
Column Formula ---->
@If(FRMKPI_Type=“Yes”;@Trim((FRMKPI_RESDEPT)+@Trim(FRMKPI_OLD));@Trim((FRMKPI_RESDEPT)+@Trim(FRMKPI_DESC)
Subject: RE: key value limitation?
I guess the value in that particular doc differs from your key. Try debugging using @dbcolumn on first columns… and see whether the key column is having the valid data…
Also, try searching without the exact match parameter for GetDocumentByKey i.e (i.e. GetDocumentByKey.(Key,False) method and using just one field as a key…
Subject: RE: key value limitation?
There’s no reason the lookup shouldn’t work, if your key really does match. I would check that the value is really really the same, including any spaces.
Incidentally, you don’t have to use Evaluate to find out the server name of the current database. Just use the NotesDatabase.Server property.
Make sure you have only one view named VSUOM – check the aliases also.
Have you debugged it to make sure the lookup is not working? From the code you posted, it could also be the case that the lookup worked but the FRMKPI_UOM of the document you find, is blank.