Article
"Undefined is not an object (evaluating 'ruleConfig.rule')" error while opening a section
17:14 Jun 11, 2018
Symptoms
Bug report:
Type: Terrasoft.SourceCodeException
Message: TypeError: undefined is not an object (evaluating 'ruleConfig.rule')
Cause
BusinesRuleManager in the edit card executes the rules at the same time, in parallel.
Solution
1. In Configuration, add a custom schema with the “Source code” type, e.g., with the “UsrMobileUtilities” name;
2. Paste the following code in the schema:
Ext.define("Terrasoft.BusinessRulesManager.Override", {
override: "Terrasoft.BusinessRulesManager",
/** * @private */
doExecuteRules: function(config) {
this.executionConfig = config;
this.allRulesAreValid = true;
this.executeRulesForNextRecord();
},
executeRules: function(config) {
if (this.rulesToExecute > this.rulesExecuted) {
this.waitRulesInProgressId = setInterval(function() {
if (this.rulesToExecute === this.rulesExecuted) {
clearInterval(this.waitRulesInProgressId);
this.doExecuteRules(config);
}
}.bind(this), 500);
} else {
this.doExecuteRules(config);
}
}
});3. Save changes.
4. Connect this schema in the mobile application manifest (for example, “MobileApplicationManifestDefaultWorkplace”) in the “CustomSchemas” section:
"CustomSchemas": [
"UsrMobileUtilities"
]

5. Save changes.
Alternative solution: fill out the City, Regions and Countries lookups (connected fields must also be populated).