I have an app which acts as a front end for all databases that users have access to on our domain. To make things a bit nicer for them, I’ve set it up so that it tests for a server, and if it finds it, then they are online, if not, then they are offline, and get different options.
However, when the server being tested goes down (which it has started to do quite often) all the users are told they are offline, when in fact they are not.
The computed field which did the testing has the formula:
@IfError(@DbExists(‘a server’: “names.nsf”);“”) which returns “” if the system is “offline”.
Can anyone suggest how I could improve this? I did try checking for a file on their homeserver, but for laptop users who are working offline, that’s a bit trickier.
So can anyone think of a better way of testing to see if a client is connected to the network? I don’t mind if this is in formula or lotus script
It depends what “offline” means, really. If the database you are looking for in @DbExists is on multiple servers, then you can use a Replica ID instead of the database name, which will find it on any known replica for the user.
Otherwise, if the server is not available, then the user is effectively “off line”, are they not?
What I am really testing for is whether or not the users PC/Notes client is connected to the network. I thought the easiest way of doing this within a database was to test for a database on a server.
My reason for testing for this was to give users both a better error than “TCP/IP Host not found”, and also to stop the database form doing a number of lookups if there was no point. This was only really applicable to laptop users who would be using local replicas of this database.
I suppose I could test for a replica ID, ensuring that it wasn’t one which might be on the local machine, otherwise it could return a false positive.
Don’t suppose you could suggest a database that is on all Domino servers by default, but not in a standard Notes client? I suppose it might be worth just creating an empty database on one server and replicating it to the others…
Adrian, just thought, I hit the same issue if I use a replica ID, because I still need to provide a server name, and it’s the server that I’m trying to avoid hard coding, as I don’t want to rely on any one server.
When specifying a Replica ID you don’t need to specify a server. Notes will go through the servers known to the client containing a replica - in other words it works through the “stack” of icons for replicas of the same database.
On another tack, do your users set different Locations when they are offline? If so, you could use @Environment and look at the “Location” environment variable (as long as people have consistent Location names, of course).
If you go with checking for location instead, you can’t do that using @Environment, since that only works with non-system variables (name starts with $). You’d need to use NotesSession.GetEnvironmentString with LS to get the Location variable.
Second, you could use that value to look up the correct document in the local names.nsf, view Locations. The field LocationType should contain one of the following values:
If it’s a direct connection through port 1352 I’m not sure how you’re going to know. You could check to see if all the IP addresses are in the default subnet for a disconnected interface in Windows XP. I can’t remember what that is off the top of my head.