Hi Community,
I have this situation where I need to update all the AccountAddress records that belong to my Account and have ImdNumerador "0". In order to do that I added the following query:
var updateQuery = Ext.create("Terrasoft.UpdateQuery", {
rootSchemaName: "AccountAddress"
});
var firstFilter = updateQuery.createColumnFilterWithParameter(this.Terrasoft.ComparisonType.EQUAL, "Account", this.get("Id"));
var secondFilter = updateQuery.createColumnFilterWithParameter(this.Terrasoft.ComparisonType.EQUAL, "ImdNumerador", 0);
// Filters will be updated by AND logical operator in query filters collection.
updateQuery.filters.logicalOperation = Terrasoft.LogicalOperatorType.AND;
// Adding created filters to collection.
updateQuery.filters.add("firstFilter", firstFilter);
updateQuery.filters.add("secondFilter", secondFilter);
updateQuery.setParameterValue("Primary", false, this.Terrasoft.DataValueType.BOOLEAN);
updateQuery.setParameterValue("IsInactive", true, this.Terrasoft.DataValueType.BOOLEAN);
updateQuery.execute(function(result){
if(result.success){
window.console.log("Update Successfull");
}
},this);
This query is executed everytime I press a button that I've created in AccountPageV2.js.
When I execute this query I get the error bellow:
I'm not understanding this error because:
- I don't have any validation or rule for my Country field, so this must be a rule that comes with the default Creatio applications.
- All the records that I'm trying to update have the country field filled in, so I don't know why I'm getting this.
I would like to know why this is happening and how can I fix it.
Thanks in advance.
Best Regards,
Pedro Pinheiro