Hi Community,
I have a requirement that an error message will populate once you save a record in details section with a record no which is already exists. The error message format is like "Settlement ID is already exists with record no 1001(where 1001 is the record no of parent record)".
Here is the code below that I have written.
define("AMDSchema09eec6a7Page", [], function() {
return {
entitySchemaName: "AMDSettlement",
attributes: {},
modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
methods: {
/*setValidationConfig: function() {
// This calls the initialization of validators for the parent view model.
this.callParent(arguments);
this.addColumnValidator("AMDSettlementID", this.SettlementIDDuplicateValidator);
},*/
save: function(){
var currentvalue = this.get("AMDSettlementID");
var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "AMDSettlement" });
esq.addColumn("AMDSettlementID");
esq.addColumn("AMDClaims");
esq.filters.add("AMDSettlementID", Terrasoft.createColumnFilterWithParameter(
Terrasoft.ComparisonType.EQUAL, "AMDSettlementID", currentvalue));
esq.getEntityCollection(function(response) {
if (response && response.success) {
console.log("Test ",response);
var result = response.collection.collection.length;
if (result > 0)
{Terrasoft.showErrorMessage("Settlement ID {result} already Exists");
return false;}
else{
return true;}
}
}, this);
}
},
So I need a syntax in "Terrasoft.showErrorMessage()" which will read the column value from the console page(read from rowConfig) . Below adding the picture of console page.
Best Regards,
Jagan