Topic Options
Rate This Topic
#93932 - 12/22/03 08:21 AM a counter
webmaster500 Offline
newbie

Registered: 03/11/04
Posts: 35
**
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
This posting was submitted via the Web interface

Top
#93933 - 12/22/03 08:56 AM Re: a counter [Re: peter_romain]
martinrd Offline
enthusiast

Registered: 06/12/01
Posts: 383
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




Top
#93934 - 12/22/03 09:28 AM Re: a counter [Re: peter_romain]
ben_cantatore Offline
journeyman

Registered: 03/11/04
Posts: 131
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




Top
#93935 - 12/22/03 09:52 AM Re: a counter [Re: peter_romain]
webmaster500 Offline
newbie

Registered: 03/11/04
Posts: 35
thanks everyone..

twas also my first idea to create a seperate form, just wanted to hear other
opinions.

----- Original Message -----
From: "Cantatore, Ben (PCLN-NW)"
To:
Sent: Monday, December 22, 2003 11:28 PM
Subject: Re: a counter


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



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




Top
#93936 - 12/22/03 08:15 PM Re: a counter [Re: peter_romain]
dave_saville Offline
Stealth Member

Registered: 03/11/04
Posts: 198
On Mon, 22 Dec 2003 23:52:08 +0200, Raido Oja wrote:

>thanks everyone..
>
>twas also my first idea to create a seperate form, just wanted to hear other
>opinions.
Or you could use a data base sequence - they are designed for this.

--
Regards

Dave Saville




Top
#93937 - 12/29/03 02:59 AM Re: a counter [Re: peter_romain]
judith_a_loiselle Offline
Stealth Member

Registered: 03/11/04
Posts: 33
I reset my counter through an escalation that runs the early morning on the
first of every month.



Judith (Jude) Loiselle SAIC
Sr. Systems Integrator / AVP Program Management
(W) 858 826 7197
(C) 619 987 9441
email: judith.a.loiselle@saic.com


-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:ARSLIST@ARSLIST.ORG] On Behalf Of Dave Saville
Sent: Tuesday, December 23, 2003 12:16 AM
To: ARSLIST@ARSLIST.ORG
Subject: Re: a counter

On Mon, 22 Dec 2003 23:52:08 +0200, Raido Oja wrote:

>thanks everyone..
>
>twas also my first idea to create a seperate form, just wanted to hear
other
>opinions.
Or you could use a data base sequence - they are designed for this.

--
Regards

Dave Saville



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




Top


Moderator:  Matt Reinfeldt