We have just upgraded from 5 to 6. I have several buttons with code in them that end in @Command([ViewRefreshFields]) on a tabbed table for a form that is viewable only in the web.
I am now getting the Error 400 - Entry not found in index.
My button formula is the following:
FIELD AComments1 := “Y”;
FIELD $MainTable1 := “Comments”;
FIELD GoTo := “Add1”;
@Command([ViewRefreshFields])
If I take out the @Command, it still causes the same error.
I’ve tried FrameRefresh and that doesn’t work either.
What’s even stranger is that it still works perfectly on my test database, but the production database fails. The databases are on the same server - just different directories
Subject: @Command([ViewRefreshFields]) and WEB
I don’t think that error is being caused directly by the code in the button. Rather, it sounds like there’s a DBLookup somewhere on the form which isn’t finding the right value.
Subject: NOT the ANSWER: @Command([ViewRefreshFields]) and WEB
I created a test form with only the problem code/fields. Still get same error: Error 400 - entry not found in index.
There are NO other fields with @DbLookup on my test form.
Thanks though.
Subject: IS TOO the ANSWER: @Command([ViewRefreshFields]) and WEB
M knows what he or she is talking about. These is no way the code in that button, by itself, can be causing your error. That particular error message can only come from @DbLookup. There must be somewhere on your form, a formula that uses @DbLookup. You’ve said you copied over the “problem fields.” Are there any formulas in those fields? Keyword formulas perhaps? Any form event code?
You didn’t specify when you get the error. When you open a new form? When you click the buttons? What?
The code works when you use it in a different database on the same server, which makes sense if it’s doing a lookup to the current database – the existing document data in the two databases must not be the same, so a lookup can find a certain key in one database but not in the other.
Please, now, before you post your @DbLookup formula and ask what’s wrong with it, keep in mind that we would also need to know about the design of the view it’s referring to, which columns are sorted, what data are displayed in it, and what the value of the key is that you’re trying to look up.
Subject: RE: NOT the ANSWER: @Command([ViewRefreshFields]) and WEB
The test form I am using has absolutely NO @DbLookups.
There is a button with the following code:
FIELD TEST := “Hi World”;
@True
And a field call TEST.
When I click on the button, I get the Error 400 entry not found in index.
Subject: RE: NOT the ANSWER: @Command([ViewRefreshFields]) and WEB
Is there any code of any kind at all associated in any way with this form other than the code in that one button? Field value formulas? Keyword choice formulas? Hide-whens? WebQueryOpen or WebQuerySave agents? Anything?
Subject: RE: NOT the ANSWER: @Command([ViewRefreshFields]) and WEB
NONE. I created a test form in the database that is having the problem with only the button and a field (This still causes the error). Nothing else is in this form. It doesn’t work in the main database, but does work in a brand new database that I created that only has that form.
So, I’m guessing there is something wrong in the main database period. God knows how I would even begin to debug this. The database us huge!!!
Subject: RE: NOT the ANSWER: @Command([ViewRefreshFields]) and WEB
I’ve got several thousand web-based databases with similar code that tested fine from R5 to ND6.5.
I would guess that if everything else is ruled out (hide-whens, form property formulas, etc.) then you should explore other possibilities. Maybe you’ve got a server redirect occuring somewhere?
It’s also possible that the form itself is corrupt. You may want to try copying/pasting the form into the same (or a different) database, or creating a new copy of the database altogether and trying things out.
Subject: Answer
Restarted the server. That made my existing code work fine. What a trip!!
That makes me sick. All this time.
Thanks for everyone’s advice.
Subject: RE: NOT the ANSWER: @Command([ViewRefreshFields]) and WEB
OK. I created an entirely new database with just my test form and it works great.
Again, we just upgraded to 6. Is there something that needs to be done to databases that were originally created in 5?
Thanks