Had a problem where in the move to Lightning, we lost functionality with setting dependent picklist values. We wrote aura components but they don't allow default values for picklists to be defined, only default values for "normal" fields.. using the defaultFieldValues : objectWithFields
So, I thought I would try LWC but issue that I have found is that we are able to pass default values via import { CurrentPageReference } from 'lightning/navigation'; import { decodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
And decode them, and then pass this into the objects, but for some reason the default value given to the dependent picklists does not work. You can pass default values for e.g. in this example, number of Employees, or, Name but when passing a default value e.g. “France” to a dependent field Country, this does not seem to work.
Does anyone have an example of where this works? Or can confirm this is a limitation of LWC similar to aura limitation?
I am following https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_navigate_default
I can put my own picklists. I am also concerned that we cannot set the recordType.. but hoping that it can be passed via the url.. but I'm also seeing this is difficult?