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 0

Like

7 comments

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. 

http://prntscr.com/oyo0vz

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.

Hi, did you find a resolution to your issue? I am facing the same thing.

Show all comments