RE: Autoincrement in a set
Russ, I think I can see what's causing the confusion, but I'm not sure I can explain it.
The autoincrement field rule is working just fine in both Alpha Four and Alpha Five. As new child records get added to the table the non-linking field is incremented based on the last value *in the table*. This is to say that the next value equals the value in the 'last' record of the table, plus one. 'Last' is defined as last in record number order. It is not the last 'linked' record of any particular parent.
In your A4 application you are not using the autoincrement field rule to assign line numbers in your child browse. You're using a default value field rule, tied to a system variable which keeps track of the number of linked records each parent already has. It resembles an autoincrement field rule because it increases one by one as new children are linked to the parent... but it's not an autoincrement field rule, in the normal sense of that phrase.
To implement similar functionality in Alpha Five you will need to either follow the approach Steve recommended, or use the approach in the article mentioned at the top of this thread (by Bill, perhaps?). So far as I know Alpha Five does not have an equivalent system variable which automatically keeps track of the number of linked child records for each parent. The autoincrement field rule in Alpha Five (and in Alpha Four) is based on the last record in the table, not the last linked child. So I'd say you were mistaken when you concluded that the autoincrement field rule 'is broken' or 'won't work' in Alpha Five. However, I'd say you're right if you conclude that there is no system level variable which automatically keeps track of the number of linked children any particular parent record might have, like 'system->reg_recnumber' does in Alpha Four.
-- tom
Russ, I think I can see what's causing the confusion, but I'm not sure I can explain it.
The autoincrement field rule is working just fine in both Alpha Four and Alpha Five. As new child records get added to the table the non-linking field is incremented based on the last value *in the table*. This is to say that the next value equals the value in the 'last' record of the table, plus one. 'Last' is defined as last in record number order. It is not the last 'linked' record of any particular parent.
In your A4 application you are not using the autoincrement field rule to assign line numbers in your child browse. You're using a default value field rule, tied to a system variable which keeps track of the number of linked records each parent already has. It resembles an autoincrement field rule because it increases one by one as new children are linked to the parent... but it's not an autoincrement field rule, in the normal sense of that phrase.
To implement similar functionality in Alpha Five you will need to either follow the approach Steve recommended, or use the approach in the article mentioned at the top of this thread (by Bill, perhaps?). So far as I know Alpha Five does not have an equivalent system variable which automatically keeps track of the number of linked child records for each parent. The autoincrement field rule in Alpha Five (and in Alpha Four) is based on the last record in the table, not the last linked child. So I'd say you were mistaken when you concluded that the autoincrement field rule 'is broken' or 'won't work' in Alpha Five. However, I'd say you're right if you conclude that there is no system level variable which automatically keeps track of the number of linked children any particular parent record might have, like 'system->reg_recnumber' does in Alpha Four.
-- tom
Comment