Newer Version Available
LiveChatButtonSkill
Represents all the skills available to a LiveChatButton
except the one currently assigned. To retrieve the skill currently assigned, query
LiveChatButton. This object is available in API version 25.0 and
later.
Supported Calls
create(), delete(), query(), update()
Fields
| Field Name | Details |
|---|---|
| ButtonID |
|
| SkillID |
|
Usage
Use this object to assign a specific skill to a specific button for multi-skill routing. For example:
1String myButtonId = "button_Id";
2String myButtonDevName = "button_DeveloperName";
3List<String> skillIds = new List<String>();
4
5//Get one skill ID from button
6for(LiveChatButton lcb : [SELECT SkillId FROM LiveChatButton WHERE DeveloperName =:
7myButtonDevName]) {
8 skillIds.add(lcb.SkillId);
9}
10//Get remaining skills from LiveChatButtonSkill join object
11for(LiveChatButtonSkill lcbs : [SELECT SkillID FROM LiveChatButtonSkill WHERE ButtonId =:
12myButtonId]) {
13 skillIds.add(lcbs.SkillId);
14}
15//Retrieve all skills into a single list
16List<Skill> skills = [SELECT Id, DeveloperName FROM Skill WHERE Id IN :SkillIds];