function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lucas IslaLucas Isla 

How do I select specific fields to show in e.force:createRecord event?

Hi,

I'm trying to fire a lightning force:createRecord event on a button click, but I only want to show certain fields on the creation form.
Is there a parameter I can add to the following code to specify these fields?
var createRecordEvent = $A.get('e.force:createRecord');
        createRecordEvent.setParams({
            'entityApiName' : 'CMC_Manifest_Item__c',
            'defaultFieldValues': {
                'Issue__c': component.get("v.issue.Id")
            }
        });
createRecordEvent.fire();

 
Best Answer chosen by Lucas Isla
Raj VakatiRaj Vakati
Only way is  with the record type with pagelayout . By default it will open the page layout with all the fields on layout 
 https://developer.salesforce.com/docs/component-library/bundle/force:createRecord/specification.

 

All Answers

Raj VakatiRaj Vakati
Only way is  with the record type with pagelayout . By default it will open the page layout with all the fields on layout 
 https://developer.salesforce.com/docs/component-library/bundle/force:createRecord/specification.

 
This was selected as the best answer
Lucas IslaLucas Isla
Okay, that is what I figured. Thanks, Raj!