You need to sign in to do that
Don't have an account?
TylerBrooks
Display javascript in a VF page without pressing a button
I want to have a user's current omnichannel status on a visualforce page displayed as our servers kick users out of omnichannel and they don't realize so I would like to have their status always displayed.
I have this button that gets the status and alerts the status in an alert window but I just want the status to be displayed without them having to click the button.
Here is my code currently:
Can anyone tell me how to just return the status without clicking the button?
I have this button that gets the status and alerts the status in an alert window but I just want the status to be displayed without them having to click the button.
Here is my code currently:
<apex:page> <apex:includeScript value="/support/console/45.0/integration.js"/> <a href="#" onClick="testGetStatusId();return false;">Get Omni-Channel Status</a> <script type="text/javascript"> function testGetStatusId() { sforce.console.presence.getServicePresenceStatusId(function(result) { if (result.success) { alert('Status is: ' + result.statusName); } else { alert('Current Status is Offline'); } }); } </script> </apex:page>
Can anyone tell me how to just return the status without clicking the button?
Try call that function onLoad. Thanks,
Govindaraj.S
Please keep this community clean by closing the solved cases.
Thanks,
Govindaraj.S