Counter that works on- and offline

Hi!

I’ve managed to do a counter using a profile document. Now the problem is that the users of the database often work offline when they create documents. This results in duplicate counter numbers and I want to use an agent on the server to hand out the numbers instead. This is what I want to do:

if user is online (I guess if server is responding)

-give counter number immediately

if user is offline

-let the agent give the number next time the user logs on

is this possible? I don’t know how to check if the server is available or not, nor how to set an agent to run as quickly as a user logs on.

Thanks in advance! =)

Regards

Frank

Subject: Counter that works on- and offline

hi Frank,

Here is what your looking for :

I used it several times and it works perfectly.

HTH

Julien

www.domlike.net

Subject: Counter that works on- and offline

Hi

first off - one important thing to mention: Don’t use profile documents for counters! They get cached on the client which the database is open.

For example, the counter is at 0001 to start with. Client A opens the database and creates a document - the counter is now at 0002. Client B then logs on and does the same. Counter goes to 0003. However, as client A is still logged on, with the database open, the 0002 value is cached on client A, and the next document they create will also be numbered 0003.

There’s an entry in the FAQ’s about it. You’re much better off using a normal document via a view to do counters.

The log on side of the agent is not too easy, if you’re looking for an automatic solution, but what you could do is set up a server agent which runs periodically, looking for documents with no serial #. When the users log back in, get them to replicate, and let the server pick up the doc numbers.

HTH

kiers