Skip to main content

We would like to conditionally render one of two hyperlinks or a blank space in a Table field, based upon the value from a Model set up strictly for this purpose. It looks like we’re having an issue where the browser “Cannot read property ‘displaytype’ of undefined”, but I can’t quite figure out where my data calls are going wrong – or whether there might be another issue.


var field = '{{$Model.AOPStatus.fieldsmap.name.AoP_Status__c}}', value = '{{$Model.AOPStatus.data.0.AoP_Status__c}}', stringValue = value.toString(); $ = skuid.$; switch(value) { case 'Ready for Review' : stringValue = '<a href = "/apex/skuid__ui?page=SSA-Counselor-Approval-of-Participation">For Your Review</a>'; break; case 'Ready for Review' : stringValue = 'Approval Completed'; break; default : stringvalue = null; break; } skuid.ui.fieldRenderersffield.metadata.displaytype]afield.mode](field,stringValue);

(a) Is this Table field essentially read-only? If so, you should add a Ui-Only Formula Field and just show that. Then the Formula can determine what content to display in the column. 

(b) As of the Brooklyn release, coming out at the end of November, there will be Conditional Rendering of Table Columns so you shouldn’t need to do this at all, you’ll just be able to have 2 / 3 separate Table columns, and Conditionally Render them.

(c) As to the code above, I’m not sure why you’re setting field to the result of a merge, that definitely will be problematic, just set it to the first argument, like this:

var field = argumentsa0],

And try that.