0

I'm trying to create a Contract from an Opportunity record via $A.get("e.force:createRecord") but it's not displaying RecordType selection list.

User has access to two different RecordTypes so it must be displayed.

The issue is that we've used $A.get("e.force:createRecord") to overwritte New button for Contract and it's showing RecordType selection list, but this quickAction for Contract creation from Opportunity (previously mentioned) it's not replacating same behaviour.

What could be causing this? Do I need to display RecordType selection list as a custom development?

Our org is in Summer '19.

| improve this question | | | | |
2

force:createRecord opens a page to create a record for the specified entityApiName, for example, "Account", or "myNamespace__MyObject__c".

To display the record create page for an object, set the object name on the entityApiName attribute and fire the event. recordTypeId is optional and, if provided, specifies the record type for the created object. defaultFieldValues is optional and, if provided, specifies values to use to prepopulate the create record form.

So If you want to show the record type selection, you have do some extra stuff something like this:- Custom Record Type Selection Lightning Component with force:createRecord event

As per idea(Support Record type selection in custom Lightning component and custom VF pages) raised for this:-

Currently force:createRecord and sforce.one.createRecord take in a recordTypeId from the developer or use the default record type if none is specified. Salesforce plans to look at providing an option to display the out of the box record type selector in the future.

You can up vote the above idea so that Salesforce consider this as priority.

| improve this answer | | | | |
  • Thanks, we've created custom component and now it's working as desired! – molinet May 29 '19 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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