Just so you have an alternate solution, here's something else you can
use. I created a regular form that holds the ticket number. This form
only has 1 record in it. I have the main form run active link/filter
(whichever works bests) that looks up the ticket number (easy to do as
the record it matches against is 1). Once it retrieves the ticket
number I then have another action that does a set field action on that
field to increment the ticket to the next number.
So to recap, main form, dummy form holding the ticket number; retrieve
ticket number whenever you need to use it, and alter it as it needs to
be altered.
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:ARSLIST@ARSLIST.ORG] On Behalf Of Dwayne Martin
Sent: Monday, December 22, 2003 3:56 PM
To: ARSLIST@ARSLIST.ORG
Subject: Re: a counter
Raido,
Try something like:
Start out with Counter = 1 and OldMonth equal to the present
month.
Filter or Active Link 1:
Set Fields: NewMonth=MONTH($TIMESTAMP$)
Filter or Active Link 2:
Run If: OldMonth = NewMonth
Set Fields: Counter = Counter + 1
Else Action:
Set Fields: Counter = 1
OldMonth = NewMonth
Padding the sequence number out to three characters can be
complicated, but you can have a series of Run If's based on
it being 1-9, or 10-99 or > 99
Good luck,
Dwayne Martin
James Madison University.
---- Original message ----
>Date: Mon, 22 Dec 2003 22:21:08 +0200
>From: Raido Oja
>Subject: a counter
>To: ARSLIST@ARSLIST.ORG
>
> **
> I have to generate a number in the following number
> for each new request:
>
> [last no of year][no of month][sequence number]
>
> the sequence number hast to be 3 spaces long and it
> counts from beginning of month so at the beginning
> of each month it starts again from 001.
>
> so for the 35th request submitted on the 24th of
> december 2003 the number would look like '312035'.
>
> the year month part I can do with functions but how
> to implement the counter ?
>
> any ideas...
>
> Raido
>
> UNSUBSCRIBE or access ARSList Archives at
> http://www.ARSLIST.org (Support:
> mailto:support@arslist.org ) ARSList is hosted by
> QMX SUPPORT SERVICES at www.QMXS.com This posting
> was submitted via the Web interface
Dwayne Martin
Computing Support
James Madison University
UNSUBSCRIBE or access ARSList Archives at http://www.ARSLIST.org
(Support: mailto:support@arslist.org ) ARSList is hosted by QMX SUPPORT
SERVICES at www.QMXS.com