Display Business rule not working on list view
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:33 AM
Hi Team,
I am using the display business rule to display the expiration days based on the current date and end date.
var now = new GlideDateTime();
var nowDate = now.getDate();
now.setValue(nowDate + ' 00:00:00');
var endDate = current.getValue('u_end_date');
var endDateTime = new GlideDateTime(endDate + ' 00:00:00' );
var daysDuration = GlideDateTime.subtract(now, endDateTime);
current.setValue('u_expire_date', daysDuration.getDayPart());
current.update();
The value is displayed on the form view, not the list view.
Please provide the solution to display values in the list view.
Regards,
Mahesh.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:35 AM - edited 08-23-2023 06:36 AM
It only work on form load. On a list view, there is no "current" for example, because you are displaying several records.
You won't be able to achieve this on a list view (it could have serious performance implications too, if you could).