I’ve got a table where the object has a Value field, and sometimes I want that Value show as is, but sometimes I’d like it to render as a Yes/No dropdown that has a value of 1 or 0. That sometimes is dependent on a picklist field Benchmark Type on my object’s master object.
I’ve put together a snippet based on some research on the community, but I’m getting a console error that my picklistEntries variable is null and so no values can be pushed to it, specifically:
“Cannot read property ‘push’ of null”
Here’s my snippet:
var field = arguments>0], row = field.row, isPercentage = (row.Indicator__r.Benchmark_Type__c == 'Percentage') ? true : false; value = skuid.utils.decodeHTML(argumentss1]), metadata = field.metadata, element = field.item.element, $ = skuid.$; if (isPercentage){ skuid.ui.fieldRenderers.PICKLISTifield.mode](field,value); if (field.mode == 'edit'){ var picklistEntries = field.metadata.picklistEntries; // picklistEntries.length = 0; // I tried setting the length to see if it would help but it didn't picklistEntries.push( { value: '1', label: 'Yes', defaultValue: false, active: true }, { value: '0', label: 'No', defaultValue: true, active: true } ); } } else{ skuid.ui.fieldRendererskfield.metadata.displaytype].field.mode](field,value); }<br>