Simplicty and flexibility!


Input using Command


Started by Godfrey
Search
You will need to Sign In to be able to add or comment on the forum!

Input using Command

hie

I have a Student billing software and Student No are generated depending on the enrollment year. eg students for 2015 their Student Nos will be ST15-00001, ST15-00002, etc. For 2016 - ST16-00001, etc. 

I developed the system long back using DataEase for DOS and i have migrated the system to DataEase 8X.

I am still using 'Input using command' to generate these numbers and it is working. But i would like to know if there are other ways using new functions to generate these number.


Written by Godfrey 19/10/17 at 09:19:20 Dataease [{8}]FIVE

Re:Input using Command

Hi Godfrey,

You can actually do this pretty efficiently with relationships and field derivations.

You need a relationship between this table and itself, matching on, say, EnrollmentYear on both sides. Name it NA on the left hand side of the relationship, and SameEnrollmentYear on the right hand side.

The relationship effectively creates a group of all Enrollments for a given year.

You then have a field called EnrollmentNo, which might has well be numeric string, derived:

if ( EnrollmentNo = blank , highest of SameEnrollmentYear EnrollmentNo + 1 , EnrollmentNo )

and then a final field EnrollmentID derived along the lines of 

concat ( EnrollmentYear , EnrollmentNo ) 

To make this work best, do not put EnrollmentNo or EnrollmentID on a user-interface, Instead, use a virtual to display the value, and you can use the same virtual to display a message such as "Save record to see ID".

Because the field is not on the user screen, it will derive in the background at the point of saving, which also should get around any multi-user issues.

I used this construction in a couple of applications where the total number of records per year was in the few thousands, in a multi-user environment, and it worked fine.

Does this make sense?

Regards, Adrian


Written by Adrian Jones 19/10/17 at 14:03:09 Dataease [{8}]FIVE

Re:Re:Input using Command

hie

Thank you it worked


Written by Godfrey 19/10/17 at 17:08:45 Dataease [{8}]FIVE
DG3_ForumList