• Sonal Shrivastava
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Is there any way we can find out how many agents of a skill are online through apex code? We can see the number of agents online through supervisor console, but I need to get it on run time throgh code. The requirement is to disable the button when the chat queue reaches 150% of available online agents. 
I am creating a pre-chat page for live agent, I have copied the same code from Pre-Chat Form Code Sample mentioned in live agent developer guide, just replaced the button Ids.
I placed one chat button (ID : 573g00000008Ofd) on a VF page for testing with this pre-chat page. On clicking that, the pre-chat form opens. But when the form is submitted it always redirect to this button's custom chat page, regardless of which button I select from the drop down.

<select name="liveagent.prechat.buttons">
<option value="573g00000008Ofd">Chat Button 1 </option>
<option value="573g00000008OfY">Chat Button 2 </option>
</select>

Please let me know if I am missing something or some other code needs to be incorporated to get redirected to respective custom chat pages of the buttons.
 
The REST API used for getting list view records is /services/data/v35.0/sobjects/Task/listviews/<listViewId>/results. This API always gives first 25 records for the given listview id and the limit cannot be increased.

For rest of the objects like Account, Contact etc, it can be done through custom webservice using following approach: Get the query from the following API: /services/data/v35.0/sobjects/Account/listviews/<listViewId>/describe and then use the same query to fetch data. 

But in case of Task object, describe call i.e. /services/data/v35.0/sobjects/Task/listviews/<listViewId>/describe is not allowed. It gives the following error:
sObject type 'Activity' is not supported in describeSoqlListViews 

Is there any way to get all the records of Task ListViews?
I am creating a pre-chat page for live agent, I have copied the same code from Pre-Chat Form Code Sample mentioned in live agent developer guide, just replaced the button Ids.
I placed one chat button (ID : 573g00000008Ofd) on a VF page for testing with this pre-chat page. On clicking that, the pre-chat form opens. But when the form is submitted it always redirect to this button's custom chat page, regardless of which button I select from the drop down.

<select name="liveagent.prechat.buttons">
<option value="573g00000008Ofd">Chat Button 1 </option>
<option value="573g00000008OfY">Chat Button 2 </option>
</select>

Please let me know if I am missing something or some other code needs to be incorporated to get redirected to respective custom chat pages of the buttons.
 
The REST API used for getting list view records is /services/data/v35.0/sobjects/Task/listviews/<listViewId>/results. This API always gives first 25 records for the given listview id and the limit cannot be increased.

For rest of the objects like Account, Contact etc, it can be done through custom webservice using following approach: Get the query from the following API: /services/data/v35.0/sobjects/Account/listviews/<listViewId>/describe and then use the same query to fetch data. 

But in case of Task object, describe call i.e. /services/data/v35.0/sobjects/Task/listviews/<listViewId>/describe is not allowed. It gives the following error:
sObject type 'Activity' is not supported in describeSoqlListViews 

Is there any way to get all the records of Task ListViews?