Multiple Trigger Validation Rule

Home Forums Classic DFFS Multiple Trigger Validation Rule

Tagged: 

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #35431
      Jeffrey Boyd
      Participant

        Good day,

        I am trying to create a new rule that will operate as follows

        If Trigger A is C, D, or E
        AND field L, M, N, O, and/or P are blank
        Then field/trigger X cannot equal Z

      • #35435
        SteveE
        Participant

          I don’t think using rules will be the most effective way to achieve this. I would use some code that you will add to the Custom JS tab.

          One part that didn’t make sense was the second statement because you start with “And” then proceed to “and/or” which doesn’t seem possible. I wrote this assuming the second statement starts with “AND” then proceeds to “OR P are blank”.

          function dffs_PreSaveAction() {

          var Criteria1 = false;
          var a = getFieldValue(“FieldAInternalName”);
          if (a === “C” || a === “D” || a === “E”){Criteria1 = true}

          var Criteria2 = false;
          var l = getFieldValue(“FieldLInternalName”);
          var m = getFieldValue(“FieldMInternalName”);
          var n = getFieldValue(“FieldNInternalName”);
          var o = getFieldValue(“FieldOInternalName”);
          var p = getFieldValue(“FieldPInternalName”);
          if (l === “” || m === “” || n === “” || o === “” || p === “”){Criteria2 = true}

          var Criteria3 = false;
          var x = getFieldValue(“FieldXInternalName”);
          var z = getFieldValue(“FieldZInternalName”);
          if (x===z){Criteria3 = true}

          if(Criteria1===true && Criteria2===true && Criteria3===true)
          {
          alert(“Warning: X cannot equal Z”);
          return false;
          }
          return true;
          }

          • This reply was modified 2 years, 11 months ago by SteveE.
      Viewing 1 reply thread
      • You must be logged in to reply to this topic.