cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
778
Views
0
Helpful
2
Replies

Hitting the content under Finesse Gadget after a certain duration

santhivinnakota
Level 1
Level 1

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

 

 

 

1 Accepted Solution

Accepted Solutions

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.

Marek
Web: https://gaman-gt.com

View solution in original post

2 Replies 2

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.

Marek
Web: https://gaman-gt.com

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