It is not quite clear. Can you kindly better describe the requirement?
A mockup is welcome.
Regards
If I understand you correctly, you are looking for is an integer field that auto-increments for each new record.
I have a custom module called wcont_Contracts which has a Contract Number field that is populated by the system as an auto increment number.
The Contract Number is an Integer, Required, Read-Only field with auto_increment set to true.
In the vardef of my field is as follows:
'contract_number' =>
array (
'type'=>'int',
'required' => true,
'name' => 'contract_number',
'vname' => 'LBL_CONTRACT_NUMBER',
'readonly' => true,
'len' => '11',
'required' => true,
'auto_increment' => true,
'unified_search' => true,
'full_text_search' =>
array (
'boost' => '3',
'enabled' => true,
),
'comment' => 'Visual unique identifier',
'duplicate_merge' => 'disabled',
'disable_num_format' => '1',
'duplicate_on_record_copy' => 'no',
'audited' => false,
'massupdate' => false,
'merge_filter' => 'disabled',
'calculated' => false,
'enable_range_search' => false,
'min' => false,
'max' => false,
),
Then on the database I altered the field to be an auto-increment and start the numbers from 10000
ALTER TABLE `wcont_contracts`
CHANGE COLUMN `contract_number` `contract_number` INT(11) NOT NULL AUTO_INCREMENT, ADD INDEX `contract_number` (`contract_number`);
alter table wcont_contracts AUTO_INCREMENT = 10000;
You won't see the number in the record until after you Save, but it is created and entered for you.
Hope this helps,
FrancescaS
HI, Francesca, I really appreciate you help.
Thank you.
Greetings.
HI, Francesca, I really appreciate you help.
Thank you.
Greetings.