58.7k views
1 vote
On a service catalog item, a customer has a requirement that the start_date is before the

end_date.
Which approach is recommended to satisfy this requirement?
A. Create a Validation Script and associate it to the item
B. Create a Catalog Client UI Policy that triggers on Load of the Item
C. Create a Catalog Client Script that triggers on Submit of the Item
D. Create a Business Rule that runs on Insert or Update of the Item

User Ccpmark
by
6.8k points

1 Answer

7 votes

Final answer:

The recommended approach to ensure that start_date is before end_date on a service catalog item is to create a Validation Script and associate it with the item, which permits immediate user feedback and correction before submitting the form.

Step-by-step explanation:

To ensure that the start_date is before the end_date on a service catalog item, the recommended approach is A. Create a Validation Script and associate it to the item. A validation script allows you to define a set of conditions that must be met before the form can be submitted, making it ideal for checking date order before submission. Implementing the validation during form submission ensures that users receive immediate feedback and can correct any issues before the record is saved in the database.

Here's a step-by-step explanation of the approach:

  • Go to the Catalog Item in ServiceNow and access the Form Designer.
  • Add a new Validation Script.
  • Write the script to compare the start_date and end_date fields.
  • If start_date is not before end_date, the script should prevent submission and provide a user-friendly error message.
  • Associate the script with the catalog item, ensuring it triggers upon submission.

Option B could also work by providing immediate feedback to the user but generally is used for UI changes rather than validation. Option C would not provide the immediate feedback upon form change, and Option D is server-side, which runs after form submission and would not be as user-friendly.

User Darwin Tech
by
8.2k points