Guest User

Untitled

a guest
Feb 18th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <aura:component implements="force:hasRecordId,lightning:actionOverride" access="global">
  2.  
  3. <aura:registerEvent name="customEvent" type="c:customEvent"/>
  4.  
  5. <lightning:recordEditForm objectApiName="MyObject__c"
  6. onload="{!c.handleLoad}" onsubmit="{!c.handleSubmit}" onsuccess="{!c.handleSuccess}" onerror="{!c.handleError}">
  7. <lightning:messages />
  8. <div class="slds-p-around_small">
  9. <lightning:inputField fieldName="Name"/>
  10. <lightning:inputField fieldName="Field1__c"/>
  11. <lightning:inputField fieldName="Field2__c"/>
  12. <lightning:inputField fieldName="MasterDetail__c" value="{!v.recordId}"/>
  13. <div class="slds-m-top_medium">
  14. <lightning:button variant="brand" type="submit" name="save" label="Save" />
  15. </div>
  16. </div>
  17. </lightning:recordEditForm>
  18.  
  19. </aura:component>
  20.  
  21. handleLoad : function(component, event, helper) {
  22.  
  23. },
  24.  
  25. handleSubmit: function(component, event, helper) {
  26.  
  27. },
  28.  
  29. handleSuccess: function(component, event, helper) {
  30. var fireEvent = $A.get("e.c:customEvent");
  31. fireEvent.fire();
  32. },
  33.  
  34. handleError: function(component, event, helper, error){
  35. }
Add Comment
Please, Sign In to add comment