Tip #746: Bring in the specialist

Bring in Mr WolfWashing car on weekend is something that everyone can do on their own. Probably. But if some serious cleanup is required, one’s better off calling Mr Wolf.

Same goes for complicated cases in customer service. If you run a secure shop that deals with the cases that include sensitive or personal identifiable information, then security roles and settings in your CRM system would be fairly tight. Now, what if you need to bring a specialist to a complicated case who otherwise wouldn’t have access to the record? Sharing, of course. And CRM has a mechanism just for that – auto-created access teams.

The only downside is that adding/removing user is a manual process. Wouldn’t that be nice if system could automatically bring a specialist to the complex cases requiring some extra care?

Now let’s assume that you can identify a specialist for the case. It could be as simple as a link from a case to a product (exists OOB) and from product to a user specialising in this product (you’d have to create this relationship). Or as complicated as a Azure machine learning analyzing past cases and figuring out who’d be the most efficient in resolving this or that case.

What is missing now is a workflow action to add/remove a user to/from the record access team. Good news is that this functionality is fairly simple to add. Some assembly is required.

public partial class MyActivity : CodeActivity
{
[RequiredArgument]
[Input("Select the user")]
[ReferenceTarget("systemuser")]
public InArgument<EntityReference> User
    { get; set; }

[RequiredArgument]
[Input("Select the team template")]
[ReferenceTarget("teamtemplate")]
public InArgument<EntityReference> Template
    { get; set; }

protected override void Execute(
	CodeActivityContext context)
{
    IOrganizationService svc = context
        .GetExtension<IOrganizationServiceFactory>()
        .CreateOrganizationService(null);
		
    svc.Execute(new AddUserToRecordTeamRequest()
    {
        SystemUserId = User.Get(context).Id,
        TeamTemplateId = Template.Get(context).Id
    });
}

With this custom activity you can now create a workflow that would automatically add a specialist to a case when required.

Workflow auto bringing the specialist

Leave a Reply

Your email address will not be published. Required fields are marked *