I am trying to return values from a view which have specific prices to products. For ex. “If chicken was selected on a form it would then return the value of chicken from the view with the price of chicken.” Currently its returns an error. which is:
Field ‘—’:Entry not found in index or view’s index not built.
Code snippet:
@if(productname = “”;0;@DbLookup(“Notes”:“NoCache”;“”:“practice.nsf”;“Products”;“”;“priceperproduct”))
Can Anyone help??
Subject: Entry not found in index or view’s index not built
Hi Adam,
I think you there is an error in the dblookup. dblookup needs a key value;Here the key value is productname.And in the view the first column will be pruductname and it will be sorted.You can try the following
@if(productname = “”;0;@DbLookup(“Notes”:“NoCache”;“”:“practice.nsf”;“Products”;productname;“priceperproduct”))
Thankx,
Sujit
Subject: RE: Entry not found in index or view’s index not built
Hello Sujit-
I had tried the statement you had posted.
@if(productname = “”;0;@DbLookup(“Notes”:“NoCache”;“”:“practice.nsf”;“Products”;productname;“priceperproduct”))
Still receiving the same error (Entry not found in index or view’s index not built) I previously had. Any other suggestions.
Thanks
Adam
Subject: RE: Entry not found in index or view’s index not built
Adam,
Re
@if(productname = “”;0;@DbLookup(“Notes”:“NoCache”;“”:“practice.nsf”;“Products”;productname;“priceperproduct”))
I assume that:
a) the view “Products” is a valid view and that you can open it. In the dblookup, the view name - i.e. “Products” has to be an exact match against the name of the design element - it the design element (ie view) is called “(Products)” then that’s what you have to put in the formula.
b) when opened, the view does show values you would expect;
c) column 1 is sorted and shows the values of all “productname” fields;
try temporarily amending your code to do something similar to:
keyfield := productname;
values:= @DbLookup(“”:“NoCache”;“”:“practice.nsf”;“Products”;keyfield;“priceperproduct”);
@if(@iserror(values); 0; values);
If that dosn’t work, you can then further check it by replacing “keyfield := productname” with a real value known to exist in the view - e.g keyfield := “chickens”;
Hope that helps … John Kvalheim