Activity Forums Salesforce® Discussions What is force:createRecord in sfdc?

  • Nikita

    Member
    August 23, 2019 at 11:04 am

    Hi Saddam,

    It is an event which is fired to show the Full Record Create panel.This event opens a page to create a record for the specified entityApiName, for example, "Account", or "myNamespace__MyObject__c".

    To display the record create a page for an object, set the object name on the entityApiName attribute and fire the event. recordTypeId is optional and, if provided, specifies the record type for the created object. defaultFieldValues is optional and, if provided, specifies values to use to prepopulate the create record form.

    This example displays the record create panel for contacts.

    createRecord : function (component, event, helper) {
    var createRecordEvent = $A.get("e.force:createRecord");
    createRecordEvent.setParams({
    "entityApiName": "Contact"
    });
    createRecordEvent.fire();
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos