Salesforce Decode
Salesforcedecode
Back to questions
LWCIntermediateschemapicklistwire

Use getObjectInfo and getPicklistValues wire adapters

Real World Scenario

Hardcoded picklist values in LWC break when admin adds new values without deployment.

Expected Answer

• @wire(getObjectInfo) for recordTypeInfos and defaultRecordTypeId • getPicklistValues with recordTypeId and fieldApiName • Dependent picklist controllerValues dependentValues mapping • Handle wire loading showing skeleton UI • Refresh picklists on recordType change reactive param • Fallback when field not accessible showing permission message

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Direct answer: @wire(getObjectInfo) for recordTypeInfos and defaultRecordTypeId Also consider: getPicklistValues with recordTypeId and fieldApiName In practice: Dependent picklist controllerValues dependentValues mapping Balance speed of delivery with maintainability.

Architect Perspective

Schema wires keep UI aligned with admin changes—hardcoded picklists are deployment debt.