tags:

views:

26

answers:

2

Need a field with a 10 character alpha-numberic field for use as a customer ID. I'm going to try and be as specific as possible here, so I have broken it down into a list of questions.

  1. How do you create such a field in MySQL? -Needs to be both numbers and letters -Needs to be able to not duplicate -Needs to be auto generated -Needs to be uppercase letters -Preferably made to where letters are not confused with numbers (don't know the term)

  2. How do you implement this in SugarCRM 6.0 CE as a read only field?

I have done SOME php but it was mostly interfacing with a few different APIs.

A: 

Concerning your first question, have a look at the following SQL code:

CREATE TABLE 'test' ('col' varchar(10) NOT NULL, 'col2' varchar(25) NULL);

ALTER TABLE 'test' ADD CONSTRAINT 'U' UNIQUE ('col');

Here a table "test" is created, containing a collumn "col" which has 10 digits and must be unique.

(unfortunately I can't help you concerning SugarCRM)

chris
Is there a way that I can get both numbers and letters? I haven't tested this code yet, but is it auto-generated? I'm sorry, I forgot to put that last part in my original question.
Brian Foster