1
0
-1

I'm trying to use the Form.validateFieldRefMap() function in a maestro rule and I would like to make a DDS call on a successful validation and resolution of the returned promise. Could someone show me a code example that would work?

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Hi Blake,

      The "Dynamic Data Button" that comes by default with Maestro does exactly what you're describing, and you can see the code it runs inside its Click rule - here you'll see the use of Form.validateFieldRefMap as well as handling the returned promise to the run a DDS.

      The validateFieldRefMap by default validates the fields that have been configured as inputs to the DDS, but if you'd like to add additional fields that must be validated prior to the DDS (but not passed in as parameters to the DDS) you could amend the code with something like:

      var validationFields = item.properties.inputFieldRefs;
      validationFields.push({key: "keyName", ref: "data.fieldName"});

       

      and then you could replace the "item.properties.inputFieldRefs" with "validationFields" in the parameters for the Form.validateFieldRefMap call - note that you'd need to set the keyName and fieldName appropriately in the script above.

      1. Blake Hunter

        Thanks for the example David.

      CommentAdd your comment...