Hello Team.
There is any way to get the value of the record in the store.loadPage?
I can access to the record parameter inside of the callback.
Terrasoft.sdk.Model.addBusinessRule("ExpensesDetail", {
name: "GetRoleFromtheUser",
ruleType: Terrasoft.RuleTypes.Custom,
triggeredByColumns: ["Subcategory"],
events: [Terrasoft.BusinessRuleEvents.ValueChanged, Terrasoft.BusinessRuleEvents.Save],
executeFn: function(record, rule, column, customData, callbackConfig) {
var myrecord = record;
var passedTheTestAndIsValid = true;
var currentUser =Terrasoft.CurrentUserInfo.userId;
var store = Ext.create('Terrasoft.store.BaseStore', {
model: 'SMVwUserRoles'
});
var queryConfig = Ext.create('Terrasoft.QueryConfig', {
columns: ['SMId', 'SMUserName', 'SMRoleName'],
modelName: 'SMVwUserRoles'
});
store.loadPage(1, {
queryConfig: queryConfig,
filters: Ext.create('Terrasoft.Filter', {
property: 'SMId',
value: currentUser
}),
callback: function(records, operation, success) {
var loadedRecord = records[0];
if (loadedRecord) {
var contact = loadedRecord.get('SMRoleName');
if (contact) {
console.log(contact);
}
}
},
scope: this
});
},
position: 3
});