+ Start a Discussion

Customize the "$A.get("event.force:createRecord")" modal?

I've got a lightning component that lets the user submit a record. Once they hit submit, the standard page for creating the record pops up, which looks like this:

User-added image


Is it possible to customize this modal to only display certain things? I'd like it to look like a confirmation page (as they have entered the information for each field in a previous component), something along the lines of


"You entered:

Date xx

Dealer: YY

Press save to confirm"

Here's the code for that modal popup:

loadSalesAppointment: function(component, event, helper, customerAccountId) {
        var event = $A.get("event.force:createRecord");     
        if (event) {
                entityApiName: "Sales_Appointment__c",
                defaultFieldValues: {
                    Resource__c: component.get("v.resourceId"),
                    Dealership__c: component.get("v.accountId"),
                    Lead__c: component.get("v.customerAccountId"),
                    Start__c : StartDateAndTime,
                    End__c : EndDateAndTime
        else {
            alert("Not available")
Just to clarify: I still want the modal popup, but just a different look to it
Ashwin Kumar SrinivasanAshwin Kumar Srinivasan
You can try using overlay library and display body whatever details you have mentioned and then may be use Lightning Data Service to submit the record? - you might need to create object with the default values to be used by data service, please check the links below

Ashwin Kumar SrinivasanAshwin Kumar Srinivasan
If you want the fields editable, you can try using lightning:recordEditForm in an Overlay Library (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_lightning_overlayLibrary.htm) and set the default values but this does not work with Master Detail fields if they are not reparentable
<aura:component implements="force:appHostable" >
    <lightning:recordEditForm objectApiName="Contact">
        <lightning:messages />
        <lightning:inputField fieldName="FirstName" />
        <lightning:inputField fieldName="LastName" />
        <lightning:inputField fieldName="Email" />
        <lightning:inputField fieldName="AccountId" value="0011p00001ZQDGzAAP"/>
        <lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update" />