khanhna
asked on
dblookup
Hi experts,
I have a Notes view which has 2 column: FirstName and LastName.
FirstName LastName
AAA A1A1A1
BBB B1B1B1
CCC C1C1C1
In another form, I have a field named LN (computed) and the value for this field is:
FIELD LN:= @DbLookup("": "NoCache"; "":"";"ViewName";"AAA";2);
In fact it will return A1A1A1 but it does not. Error msg is "ERROR: Server error. Entry not found in index". I have tried: with some views it run OK, with others it returns this error. I have check but cannot find out the reason.
Please help. Thanks, Na.
I have a Notes view which has 2 column: FirstName and LastName.
FirstName LastName
AAA A1A1A1
BBB B1B1B1
CCC C1C1C1
In another form, I have a field named LN (computed) and the value for this field is:
FIELD LN:= @DbLookup("": "NoCache"; "":"";"ViewName";"AAA";2);
In fact it will return A1A1A1 but it does not. Error msg is "ERROR: Server error. Entry not found in index". I have tried: with some views it run OK, with others it returns this error. I have check but cannot find out the reason.
Please help. Thanks, Na.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for the field LN, place below formula:
res:=@DbLookup("": "NoCache"; "Servername":"dbname.nsf"; "ViewName" ;"AAA";2);
@If(@Iserror(res);"";res)
view first column should be sorted and should be a string.
res:=@DbLookup("": "NoCache"; "Servername":"dbname.nsf";
@If(@Iserror(res);"";res)
view first column should be sorted and should be a string.
Tom,
I am seeing similar variable( res) is used so many times between us. Coincidence.
I did not saw your answer. Else I wouldn't posted.
I am seeing similar variable( res) is used so many times between us. Coincidence.
I did not saw your answer. Else I wouldn't posted.
I don't know where I got this "res" from, but I've been using it for many years now. I think it's used in the Help, or maybe in a Lotus Course or something ?
But if you want to claim "res" as your own, I'll use something else from now on :-)
cheers,
Tom
But if you want to claim "res" as your own, I'll use something else from now on :-)
cheers,
Tom
even i use res , must be from help :)
Partha
Partha
yeah. May be.
No need to shift to another variable TOm. Let us use the same.
No need to shift to another variable TOm. Let us use the same.
Maybe the error here is simpler than not catching the @DbLookup error, which sould be catched always.
If the ViewName expression in the formula is the name of a variable or a field, the formula should read:
FIELD LN:= @DbLookup( "":"NoCache"; ""; ViewName; "AAA"; 2 );
PS: "res" clearly stands for "result", but it also means "(a) thing" in latin... :-) like "res publica", which means "the state"
If the ViewName expression in the formula is the name of a variable or a field, the formula should read:
FIELD LN:= @DbLookup( "":"NoCache"; ""; ViewName; "AAA"; 2 );
PS: "res" clearly stands for "result", but it also means "(a) thing" in latin... :-) like "res publica", which means "the state"
Are you sure that the column does contain "AAA". Isn't it possible that it contains spaces? A better idea will be to modify the column formula to trim(firstname) and discard/rebuild the index prior to testing it.
res:=@DbLookup("": "NoCache"; @dbname;"ViewName";"AAA";2
@if(@iserror(res);"Error";