Adding records


Each button event on the inherited forms/frames will have an "inherited" event.


So you already know that, in the "frmBaseCRUD" from which it was inherited, there is a default initial code that RadCORE will execute, and you can insert something after the inherited "inherited."



By default, when starting a new record, RadCORE feeds the primary key (in the case of integer / string ) with the value -1, when saving the record, the new sequential is generated and replaced.


If you want the sequence to be generated automatically by RadCORE, you must inform in the MENU configuration:



rc_BuildMenuItem( '',  0, 'Cidades tbl:cidades genid: ' ); // "genid:"


With the "genid:" attribute informed, the line of code for generating the sequence must be manually added as described in this same "frmCadCIDADES" by the "btnSaveRegClick" event code or configured by yourself according to your needs:




Study the code referring to btnNewReg's click on frmBaseCRUD and frmBaseCRUDDetail to understand what is done BEFORE executing the options that inherit the respective forms.


Studying the various examples that follow RadCORE, you will be able to see variations according to the type of screen and thus help you to better understand how to apply it in your projects.

Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator