custom field renderer causes record type related picklist value issue

  • 1
  • Problem
  • Updated 2 years 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') {
skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field, value);
Photo of Kaede Holland

Kaede Holland

  • 3,176 Points 3k badge 2x thumb

Posted 2 years 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

  • 3,176 Points 3k 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,858 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.