function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jason McCarthy 2Jason McCarthy 2 

Use Apex to automatically refresh enhanced list view?

I have a Trigger & Handler that update records based on specific critieria being edited on the records. I want to use the enhanced list view to mass edit these records for my teams. The only issue is that the list view does not refresh after update. So the records are edited, the trigger fires and updates the records, but the users won't know the data is there until they manually refresh the list view, and i want to avoid a user re-entering data, or creating bad data, dupes etc. I want the list view to refresh on edit of any fields in the list view. What is the easiest avenue for making this happen? 

My first though is add the functionaility into the handler that would gather a list of the list views for the logged in user, and make a soql query for all fields on the views that would be If xxx__c is edited then refresh ListviewID. 

This guidance i need is: 
1. Can i add the functionailty that would tell the handler that ThisUser is viewing ThisListView with TheseFields. TheseFields onUpdate refresh ThisListView? 
2. Is there an easier way than blowing up my handler from 333 lines to god know how many lines. 
3. My assumption is there will be performance issues with the list view, should i put this functionaility to a VisualForce page?
4. With a VisualForce page, i will have to create all the functionailty for:
       - Listing the Views
       - Capturing the logged in user.
       - User Inputs specfic to the critieria that fires the previous trigger to update records.
       - Etc. Etc. Etc. 

I want to avoid making this a visualforce page for many reasons, and i feel that this can be achieved through a much simpler route.