Guest User

Untitled

a guest
Jan 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <aura:component implements="forceCommunity:availableForAllPageTypes,force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" access="public">
  2.  
  3. <aura:attribute name="contactRecord" type="Contact"/>
  4. <aura:attribute name="recordError" type="String"/>
  5. <aura:attribute name="returnedError" type="String"/>
  6.  
  7.  
  8.  
  9. <force:recordData aura:id="recordLoader"
  10. recordId="{!v.recordId}"
  11. mode="EDIT"
  12. targetFields="{!v.contactRecord}"
  13. targetError="{!v.recordError}"
  14. fields="FirstName, My_Test_Formula__c"/>
  15.  
  16. <!-- Display Lightning Data Service errors, if any -->
  17. <aura:if isTrue="{!not(empty(v.recordError))}">
  18. <div class="recordError">
  19. <ui:message title="Error" severity="error" closable="true">
  20. {!v.recordError}
  21. </ui:message>
  22. </div>
  23. </aura:if>
  24.  
  25. <div>
  26. {!v.contactRecord.FirstName}
  27. <lightning:button class="slds-button" onclick="{!c.changeNameToSusie}">Change Name</lightning:button>
  28.  
  29. </div>
  30.  
  31. <aura:if isTrue="{!not(empty(v.returnedError))}">
  32. {!v.returnedError}
  33. </aura:if>
  34.  
  35.  
  36.  
  37. </aura:component>
Add Comment
Please, Sign In to add comment