List view field value and form view field value doesn't match

Saurav Bhardwa2
Tera Contributor

We have a Breach Duration, Duration type field on Breach Response table. We are calculating Breach Duration using display BR, we are calculating it through GlideDateTime.  Difference between created time and current time is equal to Breach Duration, which is working fine.

But display BR will only going to work on form view. It will not update the Breach Duration field in list view.
For that we use before update BR with the same code that we are using in display BR. Then we get the results in list view as well, but for that we need to update the record every time then Breach Duration form view and list view values match.

 

Is there a way to put the form display value in list view, so that it will match every time and user do not have to update the records manually?

SauravBhardwa2_0-1672252710164.png

 

4 REPLIES 4

Arav
Tera Guru
Tera Guru

Hi,

 

From the display BR, you may want to call a Script include function that does the calculation and updates the value whenever the record is viewed. In the SLA world, there exists a property that does exactly the same (i.e. calculates and displays the latest remaining times and percentages). But you will have to use this with caution as it can lead to performance issues.

 

Thanks,

Arav

If I will call it from Script Include, it won't be resolving the List view issue. Display BR will only run on form view.

Would you be able to tell me the name of the property that we use in SLA?

What I intended to say was when you open the form, you will have the display BR run and sync the value without having to run an after update BR.

 

But if your intention is to have the current value appear in list view without opening form, then you may have to think about using a Scheduled job that periodically updates the value of all records, which might be an overkill and introduce performance issues.

 

For SLA property, refer the link below. This will also work only when a task is opened.

 

https://docs.servicenow.com/en-US/bundle/tokyo-it-service-management/page/product/service-level-mana...

Thank you for your response

We are thinking about using a Schedule Job to update the list view, but I know that it can impact performance issues.
Do we have any other way so that I can update the List View without opening the form?