The standard case form component includes a case deflection component. Unfortunately we need our case form to do some things that are beyond the standard case form functionality. Is there a way to use the case deflection component on it's own? If not does anyone know if the logic is more complicated than executing a search on knowledge with the case title?

I hate that we have to replicate these components to add functionality to parts of them

2 Answers 2


You can use the case deflection component on its own, just need to tweak your form to register the event used by the deflection component and fire it with the field + field value parameters on field change or blur, for example:


<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >

    <aura:registerEvent name="appEvent" type="selfService:caseCreateFieldChange"/>

    <lightning:recordEditForm aura:id="recordEditForm"

    <lightning:messages />

    <lightning:inputField fieldName="Subject" onchange="{!c.itemsChange}"/>
    <lightning:inputField fieldName="Description" onchange="{!c.itemsChange}"/>

    <lightning:button class="slds-m-top_small" type="submit" label="Create new" />



 itemsChange : function(component, event, helper) {           
        var appEvent = $A.get("e.selfService:caseCreateFieldChange");
            "modifiedField": event.getSource().get("v.fieldName"),
            "modifiedFieldValue": event.getSource().get("v.value")


Notice, the OOTB community Case Deflection component will update automatically.

  • where did you find the documentation for the event selfService:caseCreateFieldChange? I can't find it anywhere...
    – mascot
    Mar 21, 2019 at 14:33
  • There isn’t any, we got access to it as an ISV
    – glls
    Mar 21, 2019 at 14:47
  • This code is not working for custom fields. Is this event only works for standard fields? Aug 19, 2019 at 18:18
  • its unclear what you are attempting to do, or how. please open a new post and show us the code.
    – glls
    Aug 19, 2019 at 18:45

Adding this as an answer rather than a comment since I don't have enough rep.

We tried getting this working with the code above, and it looks like as implemented above doesn't work. It only seems to monitor the subject and description fields.

The solution was a bit hacky. If you hard code the modifiedField to 'Subject', then it'll look at the right field and force the update through. See below:

    itemsChange: function (component, event, helper) {
        var appEvent = $A.get("e.selfService:caseCreateFieldChange");
        var params = {
            // modifiedField: event.getSource().get("v.fieldName"),
            modifiedField: "Subject",
            modifiedFieldValue: event.getSource().get("v.value")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .