@DbLookup works locally but not on server

Hi

I have an application which will be used to record intentions to attend functions. I added an Action to perform a check to make sure that users didn’t record their intentions more then once:

@If(@Elements(@DbColumn(“”:“NoCache”;“”;“MyResp”;2)) > 0;

@Prompt([Ok];“Duplicate response”;“You have already responded to the invitation.”);

@Command([Compose];“EmpReg”))

“MyResp” is the alias of a view (shared; private on first use) that records forms for the current user.

I’ve tried replacing the second argument (server:database) with the replica ID and with the server name and database path in the relevant places.

Whatever I do, the button works on a local replica but throws an error on a server replica:

“Index is not to be generated on server.”

This application is not going to be distributed beyond one site. Does anyone have any ideas?

TIA

Subject: @DbLookup works locally but not on server

Is the private view already built before the lookup is performed? Try using the view name rather than the alias. Also, try using @DbName in your DbColumn code

@DbColumn(“”:“NoCache”;@DbName;“MyResp”;2)

Subject: RE: @DbLookup works locally but not on server

I forgot to mention that I’d tried @DbName without success.

I didn’t consider the impact of the view not having been primed first! Looks like I’ll have to try @DbLookup instead.

Thanks for the tip!

Subject: RE: @DbLookup works locally but not on server

Reading the error message, I would assume, that the problem might not so much be the index not being built yet, but rather users not being allowed to create private views in that application at all.

If so, a new private view is still created, but it’s stored in the user’s desktop, not in the database on the server. Consequentially, the lookup would have to fail.

Personally, I avoid private views wherever I can and in this scenario I would rather go for a @DbLookup on a public view sorted by user name. I assume that this is, what you meant with your comment regarding @DbLookup.

Subject: RE: @DbLookup works locally but not on server

Lightbulb comes on

Thanks - I should have remembered that! I’ve now created a new view that’s not available to casual users that just holds the names of respondees. The action button now looks for the user’s name in that view, and either opens the form or tells then no. So far, it’s working.