How to set values for fields in Detail Schema page through Entity Schema Query
Dear Community,
if it is an Section page will set values for fields using: this.set("UsrName", variablename), How we need to set values for fields in Detail schema page though ESQ.
Thanks in Advance,
Regards,
Mansoor
Like
Hi Mansoor,
Please provide more details on the task you want to achieve (with screenshots if possible).
Best regards,
Oscar
Hi Oscar Dylan,
define("idlcSchema9ba7e206Detail", [], function() {
return {
entitySchemaName: "idlcCIF",
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
diff: /**SCHEMA_DIFF*/[
{
"operation": "insert",
"name": "Button-9d7dd2b492b34828ac4c87e44089bf7f",
"values": {
"itemType": 5,
"id": "4d948f55-75d1-44e7-8638-8e416945ff2d",
"style": "default",
"tag": "idlcAML",
"caption": "Add CIF Request",
"click": {
"bindTo": "OnClickCIFRequest"
},
"enabled": true,
"layout": {
"colSpan": 12,
"rowSpan": 1,
"column": 0,
"row": 0
}
},
"parentName": "Detail",
"propertyName": "tools",
"index": 0
},
]/**SCHEMA_DIFF*/,
methods: {
init: function() {
this.callParent(arguments);
},
OnClickCIFRequest : function(){
this.addRecord();
},
addRecord: function(editPageUId) {
this.callParent(arguments);
var LId = this.get("MasterRecordId");
var eL = this.Ext.create("Terrasoft.EntitySchemaQuery", {rootSchemaName: "Lead" });
eL.addColumn("Id");
eL.addColumn("Contact");
eL.addColumn("Account");
var LFilter = eL.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Id", LId);
eL.filters.add("productFilter", LFilter);
eL.getEntityCollection(function (result) {
if (result.success) {
result.collection.each(function (item) {
var contact = item.get("Contact");
this.set("idlcContact", contact);
});
}
}, this);
}
}
};
});
This result values we need to set(assign) to Detail schema page fields through ESQ, if it is an Section page will set values for fields using: this.set("UsrName", variablename), How we need to set values for fields in Detail schema page though ESQ, this.set is not working for assigning field values.
Regards,
Mansoor
Hi Mansoor,
According to the code you need to update the value in one field for all the detail records using ESQ when clicking the custom button. You need to use the "Terrasoft.UpdateQuery" esq where you can set the parameter values inside the update query and then execute it. An example of such a query was already provided in this community post or in this community post or in this community post where Ryan explained how to use Insert and Update queries from the client side. Please study all these examples and create your own update query logic.
Best regards,
Oscar