Display Business rule not working on list view

maheshch18
Tera Contributor

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

Laszlo Balla
Mega Sage
Mega Sage

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).