I'd like to find the best way in Maestro to have a field validated by a local synchronous validation Rule first and then, pending the success of a local validation rule, it would make a remote asynchronous request call to a Dynamic Data Service which would return if the input to the DDS was valid or not and display a validation error message for invalid input.
The main issue with this approach is that the local synchronous validation rule is called multiple times indeterminately, including after the remote asynchronous call to a DDS which could display it's own validation message. If the local validation is called again after the remote validation, it will overwrite the remote validation message with either its own validation message or nothing if the first validation rule passes.
Below is the best approach I have come up with. I have a standard local validation rule that is being called at indeterminate times and a change rule that will make a remote DDS call and then explicitly call the local validation rule to pass a message if the input for the DDS call is invalid.
In my approach, the problem with the local validation rule being called after the remote validation (and thus overwriting the validation message) is mitigated by putting an if condition in the local validation rule so that it will not execute the local regex validation if a validation message is returned from the remote DDS call.
There has to be a better way to do this. If not, should this be functionality that is supported natively to Maestro?
Maestro 5.0.17 includes support for this type of validation approach where you wish to validate locally and only validate remotely when the value has been changed.
You will find a new event type called Validate after change if...
You can have both a standard (local) validation rule as well as a Validate on Change rule that calls a Dynamic Data service and returns a promise:
The Validate on Change rule will be triggered only when the local validation has passed and the value in the field has changed.
Hey Blake, did this new event type satisfy your requirement?
Thanks lot Ben, This Worked for me