Events are oportunities created by the Scriptcase to the developer insert his own code in order to customize the applications, each event will run in a different period of time making the business rules creating even more easy.
Each application has different events because they have different definitions, for example, in the grid application there is the onRecord event, only exist on grid applications, that will run one time for each line loaded in the grid application, on form and control applications there is the onValidate event that will run every time when the appliation is submited.
Here is a list with the most used events in each application in Scriptcase:
- onApplicationInit – This event runs when the application is loading just for the first time.
- onNavigate – This event runs when navigating from one record to another one.
- onScriptInit – This event runs when the application is loading.
- onRefresh – This event runs to reload the page of the application.
- onLoadRecord – This event occurs when the page is loaded before printing each record.
- onValidate – This event runs by clicking on the validation (OK, Update, Insert, Delete, Filter) depending on application.
- onValidateFailure – This event runs if the validation is failured. With errors.
- onValidateSuccess – This event runs if the validation is successfully. Without errors.
- onBeforeInsert – This event runs before insert a record.
- onAfterInsert – This event runs after insert a record.
- onBeforeUpdate – This event runs before updating a record.
- onAfterUpdate – This event runs after updating a record.
- onBeforeInsertAll – This event runs before inserting any record.
- onAfterInsertAll – This event runs after inserting all records.
- onBeforeDelete – This event is executed before the deletion.
- onAfterDelete – This event runs after the deletion.
- onBeforeUpdateAll – This event runs before updating all records.
- onAterUpdateAll – This event runs after updating all records.
- onBeforeDeleteAll – This event is executed before the removal of all records.
- onAfterDeleteAll – This event runs after the elimination of all records.
- onLoad – This event occurs when the page is loaded, ie when navigating from one record to another one, clicking on the buttons (new, insert, etc. earlier.).
Any event can use pre-defined functions (macros) that are available in Scriptcase. These functions are called “Scriptcase Macros”.
Visit our blog and check out more articles like this one!