Skip to main content

Hi,

 

I have a couple of rules. I initially have one rule disabled.

During my form entry, In a seperate rule I want to enable this disabled rule, is that possible?

 

i.e. Inital state of rule disbaled

Using form, user clicks a button, it triggers a button click rule, but then i want to enable another rule as part of the button click rule.

 

Possible?

Hi Sharpharp1,

 

Is there a way you could structure it as one rule using an IF statement?

 

When Button is Clicked
    Do XYZ

    if(someCondition)

        Do ABC

 

Regards,


Mike


Also, check out what I found when creating a rule for another project...

 

14189i7A205B2E752C5577.png


Can you run a rule if it is DISABLED though?


Hello Sharpharp1,

From my understanding, disabling rules is primarily there as an option for testing out your form's functionality with/without it. In its disabled state, it really can't do anything. 

The following need to be considered when disabling a Rule:

  • Changes to the parent View/Form, such as adding/removing/editing of Actions or Conditions will still be applied to the child. However enabling or disabling Rules will not be applied to the child as the inheritance is lost.
  • When a Rule is disabled all Actions, Conditions and Events contained within that Rule is also disabled.
  • When a Rule is disabled the Rule can still be removed but it cannot be edited.
  • If a Rule is disabled and it contains an Action to execute another rule, that rule will not be executed as the parent rule is disabled. 

 

Also, this article may be helpful for your design considerations: http://help.k2.com/KB001355#


Is the rule that is disabled a rule on a control by any chance? Or would it be possible to use different states? You could set up different rules on another state that could be enabled after your triggering button control if you don't want to use the If statement option.


Sharpharp1,

 

If your rule is disabled, I don't believe you'll be able to execute it.  If you can find a way to programatically say "I only want this rule to occur when THIS happens, or after THIS" you should be able to use some value on the form or underlying smartobject to use something like an if/else statement.  The "If an advanced condition is true" condition may be helpful if there's complex logic behind when that rule needs to execute.

 

Regards,


Mike


Thanks for the explanation, i kind of figured the enable/disable rule could not be set use a smartform rule, but just thought if anyone knew, this is the place to ask


I think if you have a Data Label to use as the flag and you only run that rule if the value for that Flag is true, would that not work. FOr example:

 

Create a data label called IsExecuteRule. In your rule have a f condition. If IsExecuteRule = true then execute the rules. Then from your parent rule you just change the calculate of that data field.

 


Reply