@DbLookup Error

I have a View called ServiceLines which just has two columns:The 1st Column Lists Servicelines, and the 2nd Column Lists Subservicelines.

Everything displays as you would expect it to in the view.

I have a field called serviceline on a form.

It creates a dialog list by using DbColumn to get a list of unique Sites (column 1) from the view.

@Unique(@DbColumn(“”;“”:“”;“ServiceLines”;1))

Works perfectly.

I then have a second field called subservicelines. I want to create a dialog list based on the choices of the first list, ReceivingSites.

Using the formulas given in Lotus 6.5.1 help files I get:

@DbLookup( “” : “NoCache” ; “” : “” ; “ServiceLines” ; serviceline ; 2)

I’ve tried many variations - but always get the error:

Entry not found in index or view’s index not built

I have a default view and the first column in the view is categorized and sorted.

Any idea what may be causing this? I am chosing use formula for choices in the field properties and entering the formula there.

Any help much appreciated,

Sai.

Subject: @DbLookup Error

Take care of the following points:

If you create a new document, the field serviceline is empty. In this situation the lookup will always generate an error. You should wrap the lookup in an if clause like so:

@If(

serviceline = “”;

“Pick a service line first|”;

@DbLookup(“”:“NoCache”; “”; “ServiceLines”; serviceline; 2)

)

To make sure, that this code is reevaluated after the user choose a service line, make sure, that the option “Refresh fields on keyword change” is set.

The error “view index not built” looks a little strange. Make sure that the view is set to refresh it’s index automatically and that Discard is not set to “After each use”.

If the first column of ServiceLine is categorized, the values retrieved by @DbColumn are unique already, so there’s no need for an additional @Unique (although this will have no influence on your problem).

Since both formulas access the same view, I would not use a cached @DbColumn and then an uncached @DbLookup. You should use @DbColumn with the ReCache option instead and make a cached @DbLookup.

Subject: @DbLookup Error

I think its just a spelling mistake!You say your field is named servicelines whereas in the @dblookup formula you are using serviceline (missing s) as the lookup key!

Subject: RE: @DbLookup Error

Hi Arshad,

The field name is serviceline only. there is no spelling mistake in that.

Thanks,

Sai.

Subject: RE: @DbLookup Error

Is ReceivingSites also a field?If yes then is this the first field i.e the one which for you are using @dblookup?

If I understand correctly you have a field serviceline for which you have used @Dbcolumn. You have another field for which you want to use @DbLookup based on the value of serviceline field - correct?

Have you also checked whether the first column of the ServiceLines view is sorted? @DbColumn works on the first sorted column only.