Skip to content

Instantly share code, notes, and snippets.

@simpluslabs
Created November 13, 2018 13:42
Show Gist options
  • Save simpluslabs/b084b72e4df8e4105e7a42239d7baccd to your computer and use it in GitHub Desktop.
Save simpluslabs/b084b72e4df8e4105e7a42239d7baccd to your computer and use it in GitHub Desktop.
<aura:component>
<!--lightningRecEditFormComp-->
<aura:attribute name="disabled" type="Boolean" default="false" />
<aura:attribute name="saved" type="Boolean" default="false" />
<aura:attribute name="showSpinner" type="Boolean" default="true" />
<aura:if isTrue="{!v.showSpinner}">
<lightning:spinner />
</aura:if>
<aura:if isTrue="{!!v.saved}">
<lightning:recordEditForm
aura:id="createAccountForm"
onload="{!c.handleLoad}"
onsubmit="{!c.handleSubmit}"
onsuccess="{!c.handleSuccess}"
recordId="0017F00000RxUwTQAV"
objectApiName="Account">
<lightning:messages />
<lightning:inputField fieldName="Name" />
<lightning:inputField fieldName="AccountNumber" />
<lightning:inputField fieldName="Type" />
<lightning:inputField fieldName="Industry " />
<lightning:inputField fieldName="BillingStreet" />
<lightning:inputField fieldName="BillingCity" />
<lightning:inputField fieldName="BillingState" />
<div class="slds-m-top_medium">
<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="save" label="Save" />
</div>
</lightning:recordEditForm>
<aura:set attribute="else">
<p>Saved!</p>
</aura:set>
</aura:if>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment