custom field renderer causes record type related picklist value issue

  • 1
  • Problem
  • Updated 9 months ago
  • Solved
Hi there!

We have a custom field renderer on a picklist field that will highlight the row's background in a nice green color when the picklist value says "Completed"

However, when that custom field renderer is on, the picklist values available to the user include all picklist values, regardless of record type. So we are getting some wonky data with users selecting picklist values that they shouldn't be able to select for that record type.

Is there an easy fix? Or even a kind of easy fix? Here's the custom field renderer:

// requiredQuantityRenderer.js
var $ = skuid.$;
var field = arguments[0];
var value = arguments[1];
var row = field.row;
if (value === 'Completed') {
    field.item.element.addClass("highlight-row");
}
skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field, value);
Photo of Kaede Holland

Kaede Holland

  • 2,744 Points 2k badge 2x thumb

Posted 9 months ago

  • 1
Photo of Peter Hale

Peter Hale, Employee

  • 330 Points 250 badge 2x thumb
If you don't use the custom renderer, does it show the right picklist values?
Photo of Kaede Holland

Kaede Holland

  • 2,744 Points 2k badge 2x thumb
Yes - that's how I narrowed it down to the renderer :) 

The users love the green highlight - so i have to figure out how to give that to them without also allowing them to choose the wrong values and mess up our data. 
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Hi, Kaede. This is just a guess, but if you are on Millau Update 1, you'll need to use skuid.ui.getFieldRenderer instead of skuid.ui.fieldRenderers directly. RecordTypes are Salesforce specific functionality, so we moved all of the dependency detection logic to the Salesforce Data Source code, so that it will only be evaluated when you are dealing with a Salesforce field.