22850 Posts in 9874 Topics by 2803 members
|Go to End|
10 December 2011 at 8:07pm
Currently i'm working on a project that has a client dataobject i have this setup and can add clients from both the CMS and also a front end form. as there is a current client list going in that has already established client numbering system, i would like new clients to have a number that follows on from the last number, this number needs to auto generate when a new client is added from either the CMS or the front end form.
so far i know this is done using onbeforewrite, but i have no idea of what to put or where to put it.
hope someone can help or atleast point me in the right direction thanks
10 December 2011 at 9:38pm
I'm guessing the "ID" is insufficient?
11 December 2011 at 1:04pm
The id maybe ok, i had considered using this and appending a group of numbers before, this would mean renumbering the entire client base that exists.
however as the project is aimed at consolidating several business functions currently residing in a series of excel spreadsheets and various other documents into a single application to be used company wide, this maybe a plausable solution as everything else is going to work around the client number.
the main reason for not wanting to use the id is more to learn an alternative method to solve this problem as it will no doubt come up later in the project when i start intergrating their mapping software and other systems their may be a requirement to have several fields that do this in a single table.
14 December 2011 at 9:40pm
i have spoken to my client and they wish to keep thier current numbering system in place this makes Using the ID not possible
so if anyone could help please it would be appericated.
14 December 2011 at 10:06pm
$iNewCustomerNumber = intval(DB::query('SELECT MAX(CustomerNumber) FROM CustomerTable")->value())+1;
|Go to Top|