How do I set a UI action condition for when a date passes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 10:29 AM
Hi, I want to have a UI action that appears when a hardware asset's warranty has expired. What would the condition for this be?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 04:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 11:30 AM
Hi Bushra,
Use the following in condition of UI Action;
current.warranty_expiration.getDisplayValue()<gs.now()
Hopefully this will resolve your problem.
Regards,
Muhammad Khan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 12:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 08:20 AM
Hi Bushra,
If still your problem is not resolved then you need to check whether the condition field is returning true or false by logging it as follows;
1. UI Action's Condition: gs.info('Result of UI Action Condition: ' + (current.warranty_expiration.getDisplayValue()<gs.now()).toString())
2. Open two records (one expired and one not expired) of alm_hardware table.
3. Navigate to System Logs > System Log > All, and look for the records as follows;
4. Make sure to check these log results/records properly to the corresponding records of alm_hardware table which you had opened.
Note: Above steps are basically used to debug your problem, then move towards the solution, if possible in my capability.
Regards,
Muhammad Khan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 01:29 PM
Hi,
You can try using:
new GlideDate(current.warranty_expiration) < new GlideDate()
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!