Hi
I'm trying to do something quit simple but it is not working.
On the event of changing the Account in the LEad section, I want to set the PrimaryContact of the Account as a owner of a lead.
My code is like this:
onAccountChanged: function() {
var recordId = this.get("Id");
var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
rootSchemaName: "Lead"
});
esq.addColumn("QualifiedAccount.PrimaryContact.Id", "SalesContact");
esq.getEntity(recordId, function(result) {
if (!result.success) {
// error processing/logging, for example
this.showInformationDialog("Data query error");
return;
}
this.set("Owner", "SalesContact");
}, this);
When I check the value I got in "SalesContact" I can see the Id, but it won't update the lookup.
What am I missing here ?