+ Start a Discussion
Surya.236Surya.236 

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");
                                        createRecordEvent.setParams({
                                            "entityApiName": "Mysales__c",
                                            "recordTypeId" : '01280000000Ln7tAAC',
                                            "defaultFieldValues":
 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!

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