Activity Forums Salesforce® Discussions What is the use of force:createRecord in lightning components ?

  • Saddam

    Member
    October 3, 2019 at 6:13 pm

    Hi,

    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 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