How to generate customized Sequence No

rated by 0 users
This post has 1 Reply | 0 Followers

Top 75 Contributor
Posts 22
Points 390
Radhakrishnan Posted: Thu, Feb 19 2009 6:17 AM

I want to create the sequence no is like  :  abc1001xyz , in that (abc) is input of one field of same form (Textbox / dropdown box) & (xyz) is also input of another field of same form. My question is how to generate this no and how to save this into same form TABLE.

 

 

  • | Post Points: 0
Top 500 Contributor
Posts 5
Points 40
mbeaulieu replied on Thu, Feb 26 2009 1:03 PM

This can be done by putting the three properties on the form.  One for the user entered prefix, one for the user entered suffix and one for the actual combination of the prefix,suffix and sequence.  You would then create a server event on this itemtype using the onBeforeAdd or onbeforeUpdate depending on if you only wanted this to happen on the first save or on every update.

The method would need to concatenate the prefix, next sequence and suffix and populate the your unique number property.

You could also do this on the client side as well but since I dont really know what your business requirements are, this is a good starting point

The code might look something like

dim pr as string = me.getProperty("prefix") ' assuming your property name is prefix

dim sf as string = me.getProperty("suffix") ' assuming your property name is suffix

Dim myi As innovator = Me.newInnovator()

Dim seq As String = myi.getNextSequence("mysequence") ' assuming your sequence name is mysequence

Dim num As String = pr + seq + sf

Me.setProperty("mynumber",num)

  • | Post Points: 0
Page 1 of 1 (2 items) | RSS