Created
November 13, 2018 12:31
-
-
Save simpluslabs/6854b2eb9a7f734eede11dab47e3d862 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--forceRecordDataComp--> | |
<aura:component implements="flexipage:availableForRecordHome, force:hasRecordId"> | |
<aura:attribute name="newContact" type="Object"/> | |
<aura:attribute name="simpleNewContact" type="Object"/> | |
<aura:attribute name="newContactError" type="String"/> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/> | |
<!--create record in force record start--> | |
<force:recordData aura:id="contactRecordCreator" | |
targetRecord="{! v.newContact}" | |
targetFields="{!v.simpleNewContact}" | |
targetError="{!v.newContactError}" | |
layoutType="FULL" | |
/> | |
<div> | |
<lightning:card iconName="action:edit" title="Edit Account"> | |
<div> | |
<lightning:input aura:id="contactField" label="First Name" value="{!v.simpleNewContact.FirstName}"/> | |
<lightning:input aura:id="contactField" label="Last Name" value="{!v.simpleNewContact.LastName}"/> | |
<lightning:input aura:id="contactField" label="Title" value="{!v.simpleNewContact.Title}"/> | |
<br/> | |
<lightning:button label="Save Contact" variant="brand" onclick="{!c.handleSaveContact}"/> | |
</div> | |
</lightning:card> | |
</div> | |
<!--create record in force record end--> | |
<!-- Display Lightning Data Service errors, if any --> | |
<aura:if isTrue="{!not(empty(v.newContactError))}"> | |
<div class="recordError"> | |
{!v.recordError}</div> | |
</aura:if> | |
</aura:component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment