Creating a Field Validation Rule



Steps:

  1. Hello, my name is John, and today we are discussing extending  applications using Application Composer.

    Step 1
  2. In this demo, I will show you how to create a validation rule that prevents users from entering a due date that is too far off in the future.

    Step 2
  3. This is the second of four related demos that show you how to create a custom date field, display it in the UI, and create a validation rule to constrain the values users can enter.

    Step 3
  4. In a related demo, we created a due date for activities performed to solve a customer issue in a trouble ticket.

    Step 4
  5. In this demo, we prevent users from entering due dates later than one week after they create the trouble ticket.

    Step 5
  6. To create the validation rule, we begin by selecting the Server Scripts link for the object.

    Step 6
  7. And we click the Create button on the Validation Rules tab.

    Click the Add a new validation rule... button.

    Step 7
  8. We select the field we want to validate.

     

    Click the button to the right of the Field Name field.

    Step 8
  9. Click the Due list item.

    Step 9
  10. We enter a rule name. No spaces permitted.

     

    Enter the desired information into the Rule Name field. Enter

     a valid value
     e.g.
     "futureDate"
    .

    Step 10
  11. And a description.

    Enter the desired information into the Description field. Enter

     a valid value
     e.g.
     "Due date must be in the next week."
    .

    Step 11
  12. We will use the Application Composer palette to help us write the Groovy script.

     

    Click the Keywords tab.

    Step 12
  13. We can select keywords to insert.

     

    Click the newValue list item.

    Step 13
  14. Click the Insert button.

    Step 14
  15. And operators.

    Click the More menu.

    Step 15
  16. Click the >= menu.

    Step 16
  17. And we can insert functions as well.

     

    Click the Functions tab.

    Step 17
  18. Click the Date list item.

    Step 18
  19. Click the today list item.

    Step 19
  20. Click the Insert button.

    Step 20
  21. Click in the Expression field.

    Step 21
  22. Click the && button.

    Step 22
  23. Click the Keywords tab.

    Step 23
  24. Click the newValue list item.

    Step 24
  25. Click the Insert button.

    Step 25
  26. Click in the Expression field.

    Step 26
  27. Click the More list.

    Step 27
  28. Click the <= list item.

    Step 28
  29. Click the Functions tab.

    Step 29
  30. Click the Insert button.

    Step 30
  31. Click in the Expression field.

    Step 31
  32. Enter the desired information into the Expression field. Enter

     a valid value
     e.g.
     "+7"
    .

    Step 32
  33. Let's validate our script.

     

    Click the Validate button.

    Step 33
  34. The script parsed OK, so let's enter the error message.

     

    Click in the Error Message field.

    Step 34
  35. Enter the desired information into the Error Message field. Enter

     a valid value
     e.g.
     "Due date must be in the future but no more than one week from today."
    .

    Step 35
  36. Let's save and close and we are done.

     

    Click the Save and Close button.

    Step 36
  37. In this demo you learned how to create a field validation rule in Application Composer.

    You can find additional learning resources in your Oracle Fusion Help application, as well as in the Oracle Learning Library, and at Oracle University. Thank you.

    Step 37

Table of Contents  Start Topic