Metadata
Picklist values by Record Type map
Shape for returning record-type-aware picklist options from Apex to LWC.
picklistsByRecordType[recordTypeId][fieldApiName] = [
{ label: 'Value label', value: 'API_VALUE' }
];
Reusable
Small fragments and patterns meant to be copied back into real Salesforce work.
Metadata
Shape for returning record-type-aware picklist options from Apex to LWC.
picklistsByRecordType[recordTypeId][fieldApiName] = [
{ label: 'Value label', value: 'API_VALUE' }
];
Apex
Keep triggers as orchestration points and move behavior into handlers/services.
trigger AccountTrigger on Account (before insert, before update) {
AccountTriggerHandler.run(Trigger.operationType, Trigger.new, Trigger.oldMap);
}
LWC
Render table cells from a normalized field metadata collection instead of hardcoded columns.
columns.forEach((field) => {
const value = row[field.apiName];
// choose renderer by field.dataType
});