Call Javascript Method with parameter

Forums Dynamic Forms for SharePoint Call Javascript Method with parameter

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 3 months, 3 weeks ago.

  • Author
  • #25441

    Joe Keyrouz


    Is it possible to call a javascript method with a parameter?
    I have a method that will be called several times from several rules, and each rule is on a field and will call the JS method that will run depending on this field value
    so rule 1 for field 1 will call my method with a parameter
    rules 2 for field 2 that will call the same js method but with a different parameter

  • #25466

    Alexander Bautz

    When you use a custom function triggering on a rule, the “Rule friendly name” is passed as an argument to the function. This means you can do something like this:

    function ruleCustomFunc(ruleID){
            case "YourRuleID1":
                // Do whatever you want for YourRuleID1 here
            case "YourRuleID2":
                // Do whatever you want for YourRuleID2 here

    Let me know how this works out.


You must be logged in to reply to this topic.