Hi all.
Is it possible to overwrite foundset.newRecord through application level or attach it a method?
What I wanna do is to do 'something' every time a new record is done in the database.
Thanks in advance.
Best regards. Roberto Blasco.
/**
* @SuppressWarnings (wrongparameters)
*/
function initRecord() {
newRecord(true);
myTable_id = application.getUUID().toString();
tenant_id = scopes.session.g_tenant_id;
created_by = scopes.session.g_user_name;
created_timestamp = new Date();
}
We use one generic method that runs all the time when a new record gets created, regardless for which table.
foundset.newRecord() is then just one tiny part of that record-creation-method which we named scopes.utils.recordAdd(...).
scopes.my_tabla.insert(record){
scopes.db.insert(record);
}
Have you tried the table events?
you can not overwrite the newRecord function, but you can extend the foundset object of a particular table with your own functions using the entity scope.
You find this by opening the table in Servoy, select the 'method' tab and add functions (basically the same way as table events and calculations)
Users browsing this forum: No registered users and 1 guest