开发者

Entry not found in index

I tried to get the specifc value of a field using dbLookup in a hidden view, but I get this error "field:Version:Entry not found in index". I am sure that the field Version was added as in the view as a column. Column 2 is the "Version field". How do I solve this one?

@DbLookup("":"NoCache";"":"";"(vwLDoc)";ParentId+@Tex开发者_StackOverflow中文版t(Version); 2)


Assuming this code is in a field (?) Re-write your code like this

key := @trim(ParentID + @Trim(@Text(Version))); 
lkup := @DbLookup("":"NoCache";"":"";"(vwLDoc)";key; 2); 
val := @if(@IsError(lkup);@Text(lkup) + ", key:" + key;lkup);
val;

This allows you to separate the key from the DBLookup, so that you can investigate what actual value is being used to run the lookup. Concatenating 2 strings together can result in extra spaces being inserted thus creating an invalid key value.

It also handles errors more elegantly, as you can use the "val" variable without causing an ugly prompt box to appear, which also affects forms when opening them.

I would check that the view "(vwLDoc)" has a sorted column. If there are no sorted columns in the view the dblookup will always return "entry not found in index".

You can test for the key by opening the view and the just typing the key value and it should jump to any matching documents. To open hidden views simply select "View"=> "Goto" (hold the ctrl-shift key down when you do this to see hidden views), and then select the view.

If you paste the entire formula where you're using this dblookup, I can provide a better answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜