-1

We are creating the records using the Lightning component like below

   var createRecordEvent = $A.get("e.force:createRecord");

    createRecordEvent.setParams({ 
        "entityApiName": "Contact", 
        "defaultFieldValues": {
            'AccountId':accId,

        }});
    createRecordEvent.fire(); 

Is there any way to get the ID of the created record after the event is fired and the record is saved.

0

1 Answer 1

0

create a callback apex class (@AuraEnabled) which would return the Id when the record is created...

in the callback function check for the Id with the getReturnValue() method from the response..

Hope this helps!!

Not the answer you're looking for? Browse other questions tagged or ask your own question.