If I open the form, the fields compute, and the replica is found. However, if I then refresh the form, more often than not, the filed recomputes and claims it can’t find the replica. Refresh again and it finds it.
I did the same test using a replica on my local machine and got the same results.
I was hoping @DBExists would give me the correct result each and every time it calculated, however, unless I’m doing something wrong, it doesn’t seem to be very reliable…
What debugging have you done? Are you sure that the @function is failing or have you confirmed whether it is receiving good values for the database name and replica ID?
Also note that the use of @IfError is deprecated in Notes 7. I have no idea if this is really related, though. The only reason I heard of for that move is, that @IfError does not work correct for errors in computations like division by zero.
Wouldn’t you get along with a computed when composed field?
What debugging have you done? Are you sure that the @function is failing or have you confirmed whether it is receiving good values for the database name and replica ID?
As far as I’m aware there isn’t a huge amount of debugging that can be done on such a simple formula. I have tried using different servers and replica IDs and all give the same result, being that it doesn’t always find the replica first time.
I know the formula is getting good values because the replica ID is hard coded. The server is computed, but I know those values to be correct. I have also hard coded the server and get the same results. Not sure what other debugging can be done on that.
I can’t use a computed for display field, because I’m using this test to see if a server is contactable, and the form that the computed field is on will be open all day and so needs to be able to refresh to test if the server is still contactable.
Have also tried removing the @iferror and it doesn’t make any difference.
@dbExists behaves unpredictably when used on a server - to be fair the help file does say that if not as unambiguously as it should. The first form of this works reliably for me in a web application, the second form sometimes works, sometimes not.