How do I update page fields by developer means after updating records in the database (via ESQ)?

Quetion

How do I update page fields by developer means after updating records in the database (via ESQ)?

Answer

You can use the this.set(‘ColumnName’, ‘NewValue’) method to update a field value by developer means. We recommend updating fields in the callback function with preliminaty checking of the database updates.

Example of a code:

someMethod: function(){
    var value = this.get('UsrRequired');
    var updateQuery = Ext.create("Terrasoft.UpdateQuery", {
        rootSchemaName: "UsrRuleTest"});
    var filters = updateQuery.filters;
    filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
        this.Terrasoft.ComparisonType.EQUAL, "Id", 'IdValue’)); updateQuery.setParameterValue("UsrSomething", value, this.Terrasoft.DataValueType.TEXT); updateQuery.execute(function(result){ if(result.success) this.set('UsrTest0', value); }, this); }

 

Like 0

Like

Share

0 comments
Show all comments