1 Reply Latest reply: Mar 16, 2013 5:17 PM by Mandy_Wiesener RSS

    "[FieldName] validate failed." in dynamic form with no validation

    farrelldoc Community Member

      This error message has me baffled. I have read the other discussion, which talks about the error being triggered by digital signature fields,but this situation does not apply to my form/error.

       

      I have a few date fields in this form, and three of them are interacting with this error.

       

      • EventDate
      • EventDate-14
      • DateBalanceDue

       

      • EventDate is a User-Entered - Optional Date field.
      • EventDate-14 is a Calculated - Read Only Date field. (I've also tried it with the name EventDate14, and I get the same result.) In the Calculate event, I have the following script:

        Num2Date(Date2Num(EventDate,"YYYY-MM-DD")-14,"EEEE, MMMM D, YYYY")
      • DateBalanceDue is a Read Only Date field.

        Then I have actions defined that set the DateBalanceDue field to either today's date (due when the reservation is made) or equal to EventDate-14 (two weeks before the event date).

       

      After I set these conditions, I started getting the error message "EventDate-14 validate failed." every time I select EventDate. I don't have any validation in any of the three fields (or in any fields in the form, for that matter). The error only started after I added the EventDate-14 field.

        • 1. Re: "[FieldName] validate failed." in dynamic form with no validation
          Mandy_Wiesener Community Member

          Hi,

           

          you have to use this script in the exit-event from the user input-date-field. This script is correct for a subtraction. (without error messages )

           

          if(this.rawValue != null)
          {
              var sDate = util.scand("yyyy-mm-dd", this.rawValue);
              //THE SEVEN IN THE END OF THE LINE YOU CAN CHANGE WHEN YOU WISH TO ADD MORE OR LESS DAYS
              var NewsDate = Number(sDate) - (24*60*60*1000*7);
              var nDate = util.printd("dd.mm.yyyy", new Date(NewsDate));
              //DatumsUhrzeitfeld2 --> YOUR TARGET FIELD --> PLEASE CHANGE THE NAME IN YOURS
              DatumsUhrzeitfeld2.rawValue = nDate;
          }
          

           

          I hope it's helpful for you?

          Kind regards

          Mandy