onLoadRecord: function(loadedRecord) {
this.callParent(arguments);
var store = Ext.create('Terrasoft.store.BaseStore', {
model: 'Account'
});
var queryConfig = Ext.create('Terrasoft.QueryConfig', {
columns: ['Name', 'Ownership', 'AccountCategory', 'TypeOfFacility'],
modelName: 'Account'
});
store.loadPage(1, {
queryConfig: queryConfig,
filters: Ext.create('Terrasoft.Filter', {
property: 'Id',
value: loadedRecord.data.Account.data.Id
}),
callback: function(records, operation, success) {
var record = records[0];
if (record) {
var name = record.get('Name');
loadedRecord.set('OutletName', name);
}
},
scope: this
});