Skip to content

Commit 4ef7cbd

Browse files
authored
Create README.md
1 parent 2ac45f4 commit 4ef7cbd

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • Client-Side Components/Catalog Client Script/Return Date Validation
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This piece of code runs in an OnChange catalog client script for the field 'u_return_date' and validates the return date(u_return_date) in a ServiceNow Catalog item form to ensure:
2+
3+
1. A start date(u_start_date) is entered before setting a return date(u_return_date).
4+
2. The return date is within 6 months after the start date.
5+
3. Return date is not the start date or before that.
6+
7+
Let’s say with an example:
8+
9+
u_start_date = 2025-10-01
10+
You enter u_return_date = 2026-04-15
11+
12+
Steps:
13+
a)Difference = 196 days → More than 180 days
14+
b)Result: u_return_date is cleared and error shown: “Select Return Date within 6 months from Start Date”
15+

0 commit comments

Comments
 (0)