lwc-utils
lwc-utils copied to clipboard
Collection Datatable - Display Custom Metadata Type Records
I'd like to use CollectionDatatable to display custom metadata records. I use CMDT to store field mappings for some apex code that syncs fields between two objects, and it would be nice to build my own custom UI for managing those.
I would pair it with https://github.com/jongpie/CustomMetadataSaver to actually save new/edited records to the server (since you can't DML them within flow).
Thanks!
cc @jongpie
ETA end of mid to end of april, I think
New ETA, end of May => June?
De-prioritizing this as my foreseeable future is pretty slammed. Deferring back to backlog and hopefully someone else can pick up!
Per Discord, there is a limitation of LDS (dependency for figuring out columns) on not being able to work against cmdt.
Seems like this is a no go for now, since column attribute reconstruction via apex is off the table (design ethos: keep it lightweight).
For what its worth: a rough test allowed me to retrieve Object Info for a CMDT using uiObjectInfoApi. Seems like the salesforce dependency has been since resolved, unless there was a further "gotcha" that I'm missing
The CMDT here is just a sample that happened to be in the org i was testing this in, but seems to work on any CMDT
getCmdInfo.js
import { LightningElement, wire } from 'lwc';
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
export default class GetCmdtInfo extends LightningElement {
error;
objectInfo;
@wire(getObjectInfo, { objectApiName : 'RKQ__Questionnaire_Action__mdt'})
wiredObjectInfo({ error, data }) {
if (error) {
this.error = error;
} else if (data) {
this.objectInfo = JSON.stringify(data,null,2);
}
}
}
getCmdInfo.html
<template>
<lightning-card title="Object Info">
<pre>{objectInfo}</pre>
</lightning-card>
<lightning-card title="Error">
{error}
</lightning-card>
</template>
Result: