+ Start a Discussion
mukesh guptamukesh gupta 

Object Id e.force:createRecord

Hi Expert,

I am creating contact by 'e.force:createRecord', but now i want to created contact record Id. after this event. 

Can you please suggest.

Regards
Mukesh 
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi mukesh,
We cannot get record id after creating record using force:createRecord.If you want recordId after creating then you have to go for custom lightning component with a form to create record.

Please refer below link which has similar query
https://salesforce.stackexchange.com/questions/206021/forcecreaterecord-to-get-the-record-id-and-a-call-back/206260

Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.

Thanks and Regards
 
sachinarorasfsachinarorasf
Hi Mukesh,

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

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora