Skill Based Routing with Apex/Flows in Salesforce

Описание к видео Skill Based Routing with Apex/Flows in Salesforce

This video is sequeal of omni channel salesforce tutorial(LINK)
In this video, we will cover
1. What is SKill based routing
2. Why Skill based routing used when we already have Queue based routing.
3. Skill based routing options.
4. Skill based routing using Apex class with demo,
5. Skill based routing using flows with demo

"APEX CLASS FOR SKILL BASED ROUTING"

YOUTUBE DESCRIPTION BOX DOESN'T ALLOW ANGULAR BRACES. SO LIST IS DEFINED LIKE LIST[SKILL]
PLEASE REPLACE [ TO LESS THAN SYMBOL, AND ] TO GREAT THAN SYMBOL AFTER YOU COPY THE CLASS.
public class SkillBasedRoutingDemoClass {
@InvocableMethod
public static void routingCasesToAgents(LIst[String] caseIds){
//Create PSR
//Add skills to the request for the case
//Push it to queue
List[Case] casesInserted = [SELECT id,subject from Case where ID IN: caseIds];
LIst[Skill] allSkillsInDB = [SELECT id,MasterLabel from Skill];

for(Case caseRec : casesInserted){
PendingServiceRouting psr= new PendingServiceRouting();
psr.workItemId = caseRec.Id;
psr.RoutingType = 'SkillsBased';
psr.RoutingPriority = 1;
psr.CapacityWeight = 1;
psr.ServiceChannelId = '0N92x00000001OW'; //USE YOUR OWN SERVICE CHANNEL ID
psr.RoutingModel = 'MostAvailable';
psr.IsReadyForRouting = FALSE; //DRAFT state
Insert psr; //DONE WITH MY FIRST STEP

//FIND OUT THE SKILLS REQUIRED FOR A GIVEN CASE BASED ON ITS SUBJECT
List[String] matchingSkillIds = new List[String]();
for(Skill skillRec: allSkillsINDB){
if(caseRec.Subject.contains(skillRec.MasterLabel)){
matchingSkillIds.add(skillRec.Id);
}
}

List[SkillRequirement] skillReqsToInsert = new List[SkillRequirement]();
//Associate matching skills with PSR request
for(String matchingSkillId: matchingSkillIds){
SkillRequirement skillRequ = new SkillRequirement();
skillRequ.SkillId = matchingSkillId;
skillRequ.RelatedRecordId = psr.id;
skillRequ.SkillLevel = 5;
skillReqsToInsert.add(skillRequ);
}
Insert skillReqsToInsert;

//PUSH our request in to the queue
psr.IsReadyForRouting = TRUE;
Update PSR;
}
}
}

Комментарии

Информация по комментариям в разработке