Hey, Brandon,
To do this, first you’ll need to include the child relationship for the Experience object in the Case model, if you haven’t done so already. This tutorial explains how to do this:
http://help.skuid.com/m/models-conditions-filters/l/102520-include-child-relationships
Your snippet would be called as a custom field renderer on the Order Number field, and would look something like this:
var CHILD_RELATIONSHIP_NAME = 'Experiences__r', // Replace with the name of your child relationship CHILD_FIELD_NAME; // Replace with the name of the field on the child relationship you want to reference var field = arguments[0], value = arguments[1], $ = skuid.$, caseModel = field.model, caseRow = field.row, experiences = []; // Get the experiences child relationship if (caseModel.getFieldValue(caseRow, CHILD_RELATIONSHIP_NAME)) { experiences = caseModel.getFieldValue(caseRow, CHILD_RELATIONSHIP_NAME).records; } // Loop through child records; check if the "Show Order Number" field is true for any of them var showOrderNumber = false; if (experiences.length > 0) { $.each(experiences, function(i, record) { if (record.CHILD_FIELD_NAME === true) { showOrderNumber = true; } }); } if (showOrderNumber === true) { // Run the standard field renderer skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value); } else { // Do nothing }
Let me know how that works.
Emily