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
Chuck RamseyChuck Ramsey 

Creating a record with default field values in LWC

I'm using the NavigationMixin in a LWC, navigating to an object page (standard__ObjectPage) to create a new record for a custom object.. I call getRecordCreateDefaults and generateRecordInputForCreate from lightning/uiRecordApi to create an object with default field values.  After updating two additional fields in the default values object, I conver the object to a JavaScript Map and pass the Map to encodeDefaultFieldValues to set the default values for my Navigate call.  It appears that encodeDefaultFieldValues will not encode picklist defaults.  I thought it might have been a problem with the picklist value being multiple words separated by spaces (e.g., 'Minor problem. I can continue working'), however, when I replaced the picklist values with single words, the problem persists.  My new object form does not show the default value for the picklist field.