Skip to content

Instantly share code, notes, and snippets.

@mhamzas
Last active November 19, 2019 07:59
Show Gist options
  • Save mhamzas/ed8831430c26adeb7bfc694fe405fab6 to your computer and use it in GitHub Desktop.
Save mhamzas/ed8831430c26adeb7bfc694fe405fab6 to your computer and use it in GitHub Desktop.
Custom Case Deflection in Lightning Community [aura]
({
itemsChange : function(component, event, helper) {
var appEvent = $A.get("e.selfService:caseCreateFieldChange");
appEvent.setParams({
"modifiedField": event.getSource().get("v.fieldName"),
"modifiedFieldValue": event.getSource().get("v.value")
});
appEvent.fire();
})
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<aura:registerEvent name="appEvent" type="selfService:caseCreateFieldChange"/>
<lightning:recordEditForm aura:id="recordEditForm" objectApiName="Case">
<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" />
</lightning:recordEditForm>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment