+ Start a Discussion

Recordtype assignement not working in lightning 'createRecordEvent.setParams'

Recordtype assignement not working in lightning 'createRecordEvent.setParams'  not assigning the recordtype given in controller instead default recordtype to profile is showing.

var createRecordEvent = $A.get("e.force:createRecord");
                                            "entityApiName": "Mysales__c",
                                            "recordTypeId" : '01280000000Ln7tAAC',
 I need to query the recordtype and then I have to assign ? please help 
AnudeepAnudeep (Salesforce Developers) 
Hi Surya - Can you try removing the defaultFieldValues attribute because it is optional

Also, I suggest you try by querying as well. Please see the sample code here

Let me know if this helps. If it does, please close your query by marking it as solved so that it can help others in the community. Thank You!

I'm assignning default values while creating record so I need Default values attribute.