Step 2:Create a Real EDT with No of Decimals set to 0.
Step 3:Drag and drop the above EDT in the CounterField_Test and rename the field as ‘Counter’.
Step 4:Create an index using ‘Counter’ field of the table and save all.
Step 5:Create a form and add CounterField_Test as the datasource for the form. Now, in the properties window of the datasource, select ‘Counter’ in the ‘CounterField’ property.
Step 6:Add, Create override method to the datasource and rewrite the below code into it.
public void create(boolean _append = True) // Actual default value is false. Setting True as the default values will allow you to generate positive values forward.
{
super(_append);
}
Step 7:Expand design node of the form and create a grid and drag the ‘counter’ field of the datasource to the grid and that’s it.
Now, if you open the form and add a new row, it will give the incremental numbers by 1 for each row.
No comments:
Post a Comment