Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<aura:component implements="lightning:isUrlAddressable,force:lightningQuickAction,lightning:actionOverride" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="recordId" type="String"/>
<aura:attribute name="cmp" type="commission__c" default="{'sobjectType': 'commission__c'}"/>
<aura:attribute name="modalWindow" type="boolean" default ="true"/>
<lightning:recordEditForm aura:id="recordViewForm"
onload="{!c.handleLoad}"
onsubmit="{!c.handleSubmitClick}"
onsuccess="{!c.handleSuccess}"
objectApiName="commission__c">
<!-- the messages component is for error messages -->
<aura:if isTrue="{!v.modalWindow}">
<section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal_medium" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1">
<div class="slds-modal__container">
<header class="slds-modal__header">
<button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close">
<span class="slds-assistive-text">Close</span>
</button>
<h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">New Commission</h2>
</header>
<lightning:messages />
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
<div class="slds-section slds-is-open">
<lightning:inputField fieldName="Name" />
<lightning:inputField fieldName="Commissions_Booking__c" />
<lightning:inputField fieldName="Opportunity__c" value="{!v.recordId}"/>
<lightning:inputField fieldName="Rep_Name__c" />
</div>
</div>
<footer class="slds-modal__footer">
<lightning:button aura:id="save" variant="brand" type="submit" name="save" label="Save" />
<lightning:button label="Cancel" onclick="{!c.onCancel}" />
</footer>
</div>
</section>
</aura:if>
<div class="slds-backdrop slds-backdrop_open"></div>
</lightning:recordEditForm>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment