You need to sign in to do that
Don't have an account?

Lighting Pass Record Type
I am using the e.force:createRecord and want to know if I can use the name (rather than ID) to pass the record type.
I know its not good practive to hardcode the ID's but unsure about how else to pass them. Currently, I'm using:
{"entityApiName":"Opportunity","defaultFieldValues" :{ "AccountId": "#parentrecordid#", "RecordTypeId":"01239000000HrXEAA0", "Name":"Temp Name", "Region__c":"Inernational"}}
Thanks!!!
Fred
I know its not good practive to hardcode the ID's but unsure about how else to pass them. Currently, I'm using:
{"entityApiName":"Opportunity","defaultFieldValues" :{ "AccountId": "#parentrecordid#", "RecordTypeId":"01239000000HrXEAA0", "Name":"Temp Name", "Region__c":"Inernational"}}
Thanks!!!
Fred
OR
Insted of pass the recordId .. pass the record type name to the apex controller whihc will retunn ID and set to the attribute and pass it to the event
Call the apex class to get the record type Id on doInit
Set the value to attribute and call it from the event as shown above
{"entityApiName":"Opportunity","defaultFieldValues" :{ "AccountId": "#parentrecordid#", "recordTypeName":"New Business Int Student", "Name":"Temp Name", "Region__c":"Inernational"}}
Any thoughts? Thanks again!!
Fred
You can use custom label ({!$Label.c.labelName}) and store the record type Id in the same. So that you can update the value muanully (Post deployment steps).
Regards,
Naveen Ila
Thanks again!
Fred