I have a panel card that contains a handful of EDD widgets and I am having a hard time getting the widgets to refresh on an interval.
The app also contains a panel card grid and following some guides here I was able to get that to refresh on an interval.
My latest hacky attempt for the widgets is to collapse/expand the entire panel card, because that seems to refresh all the widgets in the card. I can get the card to collapse but I can’t figure out how to get it to expand again.
Is this a fools errand or am I just not seeing the light.
I have an event that is collapsing the grid successfully. I am using property-set on the card to set expand to false.
I can manually expand the card and the widgets refresh, and then the card collapses again automatically on the interval. I just cant get an event to expand the card.
Not sure how to figure out what is actually doing the refresh.
Thanks for the tips. Using the devtools I was able to figure out my action to re-expand the card wasn’t firing.
I got it to fire but it seems like my 2 events are firing too quickly in succession. This is an assumption, but when I leave the card expanded, the event to collapse the card works, but it won’t immediately re-expand. If I manually collapse it, the event will expand it, but it stays expanded.
This is confusing. Shame there is no event to just refresh all.
Are you using the dashboard-timer-set widget to call your refresh event?
Is there an event that runs on panel card expand - one that you could just call?
The event it calls uses grid-refresh to refresh the panel card grid (works) followed by property-set to collapse the card (works), followed by event-next to call an event that expands the card.
Everything seems to fire according to the interval set in dashboard-timer-set but the non-grid panel card does not behave like I would expect.
I forget how I’ve handled this … there have been a few times where an event fires, starting a cascade of actions, then fires the next item before the cascade can even get going…
What if on your panel card behavior, added an event On Panel Card Collapse to then expand the card? That should tell Kinetic to open the card after collapsing it
To get the timing right, put a kinetic-function event in between collapse and expand. Just have the function wait for a second or so: int milliseconds = Convert.ToInt32(seconds * 1000); System.Threading.Tasks.Task.Delay(milliseconds).Wait(); output = true;
I got this to work by first creating two events for collapsing and expanding the card that have no trigger and a property-set widget, one where my card “expanded” property value is false (collapse) and one where it’s set to true (expand). Then in my event that I’m using to populate my data view, I added an event-next widget that calls the collapse event, followed by a dashboard-timer-set widget with an interval of 0.01 and set to then run my expand event.
This works pretty well (obviously you need to figure out what triggers the event that houses these widgets), with one HUGE caveat: the dashboard-timer-set event continuously fires every 0.01 ms.
I was able to get that to stop by adding a dashboard-timer-clear widget after it, but that kills the card re-expanding. It’s like the events fire off too fast for the expand event to happen before the timer is cleared. I’ve tried throwing a console-write widget after the collapse event, and myriad of other things to force some sort of pause after the collapse, but so far no success.
Well this would be a great place to start because a function basically can’t get any more simple than just waiting and the function library won’t need any references to anything.
Open Epicor Functions Maintenance (will use edge agent to open the classic form, you’ll have to have the client installed for this)
Create a new library, I have one named MiscFunctions where I have one just like this.
Give it a description and check the box for Custom Code Functions (right of the screen)
Go to the Security tab and add your company to the Authorized list
Save and then add Custom Code Function
Give it a function ID and description
Make it a little flexible if you want by creating a request parameter on the signature tab like WaitTime and make it an Int
Hit the Edit button and add this code, replace WaitTime with your parameter name if it’s different or just hardcode an integer inside the () System.Threading.Thread.Sleep(this.WaitTime);
Save and then go to Actions>Promote in the top menu
Back in application studio add a kinetic-function widget