A user recently brought it to my attention that apostrophes are not rendering correctly. Instead of the correct character, it inserts “'” instead. Based on what I’ve see in this article:
https://community.skuid.com/t/field-renderer-causing-apostrophe-to-turn-into-39
the fix is to insert .getFieldValue infront of the field reference to get the correct value. However that is already present in the Custom Renderer. Here is the code:
// A custom field renderer for Client fields. Links user to the Client page within the Wealth tab, while still allowing field to be editable if in edit mode.
skuid.snippet.registerSnippet(‘ClientLinkRenderer’, function(field, value){
var model = field.model,
row = field.row,
clientName,
clientId,
clientLink,
elem = field.element,
modelObject = model.objectName;
console.log(field);
// Based on the model’s object, use different fields for the Client Id and Name
switch(modelObject) {
// Client (Account) model
case ‘Account’:
clientName = model.getFieldValue(row, ‘Name’);
clientId = model.getFieldValue(row, ‘Id’);
break;
// Pipeline (Opportunity) model
case ‘Opportunity’:
clientName = model.getFieldValue(row, ‘Account.Name’);
clientId = model.getFieldValue(row, ‘AccountId’);
break;
// Call Plan model
case ‘Call_Plan__c’:
clientName = model.getFieldValue(row, ‘Client__r.Name’);
clientId = model.getFieldValue(row, ‘Client__c’);
break;
// Restricted Client Information model
case ‘Restricted_Client_Information__c’:
clientName = model.getFieldValue(row, ‘Client__r.Name’);
clientId = model.getFieldValue(row, ‘Client__c’);
break;
Any ideas on what needs to be done to correct this?
Question
Custom Field Renderer Not Showing Apostrophes Correctly (')
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.