Invoke a rule from code Home › Forums › Classic DFFS › Invoke a rule from code This topic has 3 replies, 2 voices, and was last updated 6 years, 8 months ago by Alexander Bautz. Viewing 3 reply threads Author Posts February 21, 2018 at 07:55 #19954 Ivan WilsonParticipant Is there any way to run a rule from within a JavaScript function? Also, can I suggest adding an option to run the reverse of a rule using syntax like ~MyRuleName. February 23, 2018 at 10:23 #19999 Alexander BautzKeymaster You can trigger a rule from code like described in the top of the rules tab: spjs.dffs.triggerRule(["IndexOrFriendlyNameOfRule"]); This will run the rule as “true”, but I’ll see what I can do about letting you trigger the reverse in a future version. Alexander March 3, 2018 at 10:19 #20033 Ivan WilsonParticipant Thanks Alexander, I thought I had seen that option somewhere, but couldn’t remember where. Would it be worthwhile adding this to the user manual? Is there a way to check the last execute status of a rule in code? Ivan March 5, 2018 at 21:23 #20047 Alexander BautzKeymaster You find it in the rules tab if you expand the “Trigger rules manually” section. To see the status of a rule in your custom code, you can use this snippet: spjs.dffs.data.ruleIndexObj.YOUR_RULE_FRIENDLY_NAME_OR_INDEX Alexander Author Posts Viewing 3 reply threads You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In