07-21-2020 03:39 PM
Hello,
I need some help in getting my finesse gadget code to work and really appreciate your inputs please.
The requirement is, when the duration of a certain state is > x secs(meaning idle for x secs) , I need to refresh the CRM that is in iFRAME within Finesse.
I can get the StateChangeTime(SCT) with user.getStateChangeTime() and could convert to UTC.
By deleting this SCT with the currentUTCTime, I can get the duration.
But, without an event, how do I get the finesse client to hit this gadget?
I could get the POP to work and Notifications to work etc through gadgets on a state change--as this gadget.xml gets hit on an event.
But, I am unable to figure out how I can get the gadget.xml to invoke to get the "duration" and send the RefreshURL without any explicit event.
The sample code inside js is
var Statetime = user.getStateChangeTime();
var STSec = ~~(+new Date(Statetime) / 1000);
var CTSec = ~~(+new Date() / 1000);
var dur = CTSec - STSec ;
if ( dur > 60) {
document.getElementById("myFrame").src=CRMLinkRefresh;
}
How do I make the above code to keep getting hit and send the CRMLinkRefresh upon the duration is reached.
I tried adding the above code inside render() method that gets invoked upon UserLoad and UserChange. I tried adding outside render() as well.
Can I get some help on this please,
Thanks,
Santhi
Solved! Go to Solution.
07-21-2020 08:25 PM
Hi Santhi,
In my opinion, you can try to engage here the Finesse Container Timer and create the handler function that will be executed whenever TIMER_TICK_EVENT is generated by Finesse container. You will also need to build some prevention mechanism that will refresh the CRM page only once as the mentioned mechanism will work continuously - maybe a refresh flag that will be cleared on user state change.
07-21-2020 08:25 PM
Hi Santhi,
In my opinion, you can try to engage here the Finesse Container Timer and create the handler function that will be executed whenever TIMER_TICK_EVENT is generated by Finesse container. You will also need to build some prevention mechanism that will refresh the CRM page only once as the mentioned mechanism will work continuously - maybe a refresh flag that will be cleared on user state change.
07-21-2020 11:46 PM
Hi Marek,
Thank you for giving the direction. I will work towards using the Finesse Container Timer and TImeTickEvent to achieve this.
I will keep you posted on how I am getting on.
Thank you,
Santhi
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide