I’m working on a project around dynamics AX 2012, and I want to add some fields in CustTable.
specifically the field that I want create is a unique field (cust_Id for example) and is composed of 10 character’s divided into 4 components(segment/digit)
For example if i want create new customer , in form ,I seized sex & date birth and other fields, but the unique field (cust_Id for example) should be generate automatically based on :
1. Gender (1 digit)
•1 for men
•2 for women
2. Year of birth (2 digits)
• The last two digits of the year
• Example: 78 for 1978
3. Month of birth (2 digits)
4. Order number (5 digits) auto increment
Global example:
men 22/03/1990 00001
When I submit the form the field must contain this value : (1-90-03-00001 or 1900300001) that is the unique identifier (primary key)of new customer inserted generated automatically.
next record :
women 30/12/1994 00002 => value : (0-94-12-00002 or 0941200002)
I did some research, I found that I can do that by Number Sequence scope or segment,but i d’in khow how can i create a number sequence ,if you can explain me step by step
Are you sure that you will never have a customer who is a company instead of a person? If you will, you won’t be able to construct your ID, because companies don’t have gender and date of birth.
I would let just the last part to be generated from number sequence and I would add remaining information in code.
i want create a form based on CustTable and i want when i create new customer (record) generate my own unique identity(primary key) for each record based on fields (gender, DOB and an auto increment number)
what i m not sure is ,the CustTable can support two number sequence?
Good. So we can look at the other part of what I wrote: “I would let just the last part to be generated from number sequence and I would add remaining information in code”. Which part is not clear to you?
In the form, the user enters the gender and birth date (eg man and 30.12.1990) the unique identifier of this record should be: 112 90 0001 and this value must be recorded in the field wich i want add in custTable.
what i m not sure is can a table (custTable ) support two number sequence , because it has already a number sequence :if I can change it is the best
Your requirement says that you want to calculate the ID by your own logic, therefore you don’t want to use the number sequence anymore. And the table itself doesn’t care how will you assign a value to the field.