How can I set a value for an active record from section module in edit mode (vertical list)?

Question

How can I set a value for an active record from section module in edit mode (vertical list)?

Answer

If the column, for which the value must be set, is among the active string columns, you can try saving the active string:

var activeRow = this.getActiveRow();
activeRow.set("YourColumnName", columnValue);
activeRow.saveEntity();

To make this code work, make sure the activeRow.columns collection contains a column with the YourColumnName name and the Terrasoft.ViewModelColumnType.ENTITY_COLUMN type (this constant equals 0).

You can also implement updating the value via a request, as follows:

var updateQuery = this.Ext.create("Terrasoft.UpdateQuery", {
        rootSchemaName: "EntitySchemaName"
});
var filters = updateQuery.filters;
filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
        this.Terrasoft.ComparisonType.EQUAL, "Id", currentRecordId));
updateQuery.setParameterValue("YourColumnName", columnValue);
updateQuery.execute(callbackFunction, this);

 

Like 1

Like

Share

0 comments
Show all comments