Hi Folks,
I've built a form based on a table of my one.
Generaly, when i feed the table with some process i look for the last entry number and +=1.
But, when i hit F3 on the form the record does not increment..
What is the best easy way to handle this...?
Thanks in advance..
0
Comments
http://www.BiloBeauty.com
http://www.autismspeaks.org
a/ use a primary key of type BigInteger with the property Autoincrement set (see table 405 for an example) OR
b/you need to find the last record and use code to increment it. (see table 32 for an example)
Note that in a/ above the numbers may not be sequential and some numbers may be skipped. So if you need a contiguous series then use B/
If are using option b given by david then you could use this std code.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
donot forget to set property "NotBlank" to false.
If your data type is integer for this field you should to write code to increment tthis field like below:
YourTable.RESET;
YourTable.SETFILTER("No.","No.");
IF YourTable.FIND('+') THEN
"No. Series":= YourTable."No. Series" + 1
ELSE
"No. Series":=1;
Note: there is autoincrement property in NAVISION for the integer fields
donot forget to set property "NotBlank" to false.
If your data type is integer for this field you should to write code to increment tthis field like below:
YourTable.RESET;
YourTable.SETFILTER("No.","No.");
IF YourTable.FIND('+') THEN
"No. Series":= YourTable."No. Series" + 1
ELSE
"No. Series":=1;
Note: there is autoincrement property in NAVISION for the integer fields