I have an inquiry graph in Acumatica ERP (version 23.117.0021). In the details data view delegate, I’m using System.Diagnostics.StopWatch
to count how long it takes to retrieve all of the records. Once all of the records have been retrieved, I’m setting a string field in the filter DAC to the time elapsed.
The problem is that the time elapsed field is updating in the code but not the UI. It only updates when the inquiry is run again. So the time elapsed value is always the value from the previous execution.
How do I get this value to update on the screen?
Here is how I’m setting the time elapsed in the details data view delegate:
public virtual IEnumerable details()
{
Filter filter = this.Filter.Current;
Stopwatch stopwatch = Stopwatch.StartNew();
// Retrieve and yield return the results here.
. . .
stopwatch.Stop();
filter.TimeElapsed = stopwatch.Elapsed.ToString(@"mm:ss.ff");
}
Try to update the data in the cache:
filter.TimeElapsed = stopwatch.Elapsed.ToString(@"mm:ss.ff");
Filter.Update(filter);
If this is not enough, you can try to refresh the Filter view:
Filter.RequestRefresh();
This second one could be problematic because you are in another view delegate, and RequestRefresh
might cause an infinite loop.