Article
How do I update page fields by developer means after updating records in the database (via ESQ)?
10:21 Aug 14, 2018
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); }