Mobile Application Conditional columns is not working in rule type requirement
Hi Community,
In mobile application Conditional columns is not working in rule type requirement. Below is my code.
Terrasoft.sdk.Model.addBusinessRule("Case", {
ruleType: Terrasoft.RuleTypes.Requirement,
requireType : Terrasoft.RequirementTypes.Simple,
events: [Terrasoft.BusinessRuleEvents.Save],
triggeredByColumns: ["UsrIsClosed"],
conditionalColumns: [
{name: "UsrIsClosed", value: true}
],
dependentColumnNames: ["UsrComments"]
});
I want column UsrComments to be required if column UsrIsClosed is true. The code above is not working, please suggest
Like
Try to check if the module with the code appears on the client end. Please debug the code for this.
https://academy.bpmonline.com/documents/technic-sdkmob/7-12/mobile-application-debugging
Additionally, please check if the manifest is correct. More information in my posts.
https://community.bpmonline.com/articles/adding-custom-css-mobile-application
https://community.bpmonline.com/articles/adding-custom-user-action-mobile-application
Then check if the rule is correct.
https://academy.bpmonline.com/documents/technic-sdkmob/7-12/business-rules-mobile-application
https://academy.bpmonline.com/documents/technic-sdkmob/7-12/custom-business-rules-mobile-application
Eugene Podkovka,
Hi Eugene, Thanks for your reply
Module appears on the client end, manifest is also correct.
Using below code without conditionalColumns rule is working fine:
Terrasoft.sdk.Model.addBusinessRule("Case", {
ruleType: Terrasoft.RuleTypes.Requirement,
requireType : Terrasoft.RequirementTypes.Simple,
events: [Terrasoft.BusinessRuleEvents.Save],
triggeredByColumns: ["UsrComments"],
columnNames: ["UsrComments"]
});
But the above code will not serve our purpose, we only require "UsrComments" to be mandatory if "UsrIsClosed" field is true.
That's why I created below code:
Terrasoft.sdk.Model.addBusinessRule("Case", {
ruleType: Terrasoft.RuleTypes.Requirement,
requireType : Terrasoft.RequirementTypes.Simple,
events: [Terrasoft.BusinessRuleEvents.Save],
triggeredByColumns: ["UsrIsClosed"],
conditionalColumns: [
{name: "UsrIsClosed", value: true}
],
dependentColumnNames: ["UsrComments"]
});
Please suggest, how I can use "conditionalColumns" attribute for rule type requirement.
Fulgen Ninofranco,
The code seems like correct. Try to restart the application pool and synchronize the mobile application again.
Eugene Podkovka,
Thanks Eugene.
We already did the restart and synchronize but still not working. I also noticed one thing in the documentation. "conditionalColumns" is not discussed here as part of the attributes of rule type requirements but from other rule type it is included. Please suggest how we can achieve our condition if "conditionalColumns" will not work.
https://academy.bpmonline.com/documents/technic-sdkmob/7-12/business-rules-mobile-application
Eugene Podkovka,
Hi Eugene, any update on this. Thank you
Fulgen Ninofranco,
Try to debug the mobile application, find how business rules work and find how to adjust them according to your needs.
https://academy.bpmonline.com/documents/technic-sdkmob/7-12/mobile-application-debugging
Start from the executeApplicableRules method in the BusinessRulesManager module.