custom field renderer causes record type related picklist value issue

Kaede HollandKaede Holland Member ✭✭
edited September 2018 in Problems
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);

Comments

  • Peter HalePeter Hale Skuad
    edited February 2018
    If you don't use the custom renderer, does it show the right picklist values?
  • Kaede HollandKaede Holland Member ✭✭
    edited September 2018
    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. 
  • J.J. Skuad, Sonar 💎
    edited February 2018
    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.
Sign In or Register to comment.