How to validate a field in a Service Request

Version 1

    Details

    At this moment in HEAT 2015.1.2, it is not possible to add a validation rule in a Request Offering template field configuration.

    This article describes how to add a validation rule for a specific field. In this case we demonstrate how to validate that a date selected is not on a weekend, but the same steps would be valid for any type of validation.


    Resolution

    1.- In the Request Offering, name the date field as "NoWeekendDate" (Note: any Request Offering with a similar field name will be validated with the same rule):



    2.- In the ServiceReqParam object, add the following validation rule:

    $(if ParameterName == "NoWeekendDate"
      then if LocalDayOfWeek(ParameterValue) == 1 ||
              LocalDayOfWeek(ParameterValue) == 7
           then false
           else true
      else true)



    3.- When the user submits the Service Request, if he has chosen a Saturday or a Sunday, he will get the following message. (Note: the message includes the RecId but it is under investigation by our development team):