I got this field renderer from Skuid several years ago (pro hours). It stopped working with version 17.11.20 last week. Any ideas?
Symptoms: In Read/edit mode, the page loads but most fields are not editable, with or without the renderer.
If set to load in Edit mode, the page will not load.
Footnote: This is for a Salesforce Digital Experience site.
This code takes values from a multi-select picklist from one record and display those values as single select values in another record.
var test = skuid.model.getModel('Organization');
console.log(test);
const FieldRenderer = skuid.component.FieldRenderer;
return new FieldRenderer({
// readModeStrategy: "virtual",
// read: function (fieldComponent) {
// },
editModeStrategy: "virtual",
edit: function (fieldComponent) {
let h = fieldComponent.h,
context = fieldComponent.cpi.getContext(),
{ field, model, row, value } = context,
sourceModel = skuid.model.getModel('Organization'),
sourceRow = sourceModel.getFirstRow(),
sourceValues = sourceRow.Partner_ProfileId__r.Fulfillment_Order_Request_Types__c.split(";");
field.picklistEntries = sourceValues;
return h("select",
// We need to set up the proper event handling
// to update the model with the value selected here,
// so let's do that in the attribute object.
{
oninput(event) {
model.updateRow(row, {
[field.id]: event.target.value
}, {
initiatorId: fieldComponent.id
});
},
// onblur(event) {
// fieldComponent.cpi.onInputBlur();
// },
// Using maquette's afterCreate() function,
// make sure the edit mode dropdown reflects
// the value of the row. Otherwise, the dropdown
// displays the first picklist entry, which
// can confuse users.
afterCreate(element) {
element.value = value;
},
styles: {
width: "100%",
height: "32px",
display: "flex",
borderRadius: "3px",
border: "1px solid #dddbda"
},
},
// Next, generate "option" elements for each picklist entry.
// Let's use the field metadata's picklist entries to set up
// the proper structure
field.picklistEntries.map(entry => {
return h("option",
{ value: entry },
[`${entry}`]
)
}),
);
}
});