Display field history for the Case object.

Rob I really like what you’ve done (I didn’t know you wrote Javascript :slight_smile: ) I would just suggest using a function to handle the label text like so… instead of this

// Replace custom fields API name with their labels. You need to hard code label names.
 if (value1 === "Service_Location__c")
{<br>&nbsp; &nbsp; value1 = "Service Location";<br>}


I would do this: (I realized after the fact that you’ll never get an __r field…)

//you can use a hack-ish function to format all instances correctly<br>
//and avoid hardcoding labels...<br>
function fixFieldFormat(field){<br>
&nbsp; &nbsp; if(field.indexOf("__c") != -1){<br>
&nbsp; &nbsp; &nbsp; &nbsp; if(field.indexOf("__r.") != -1){<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var start = field.indexOf("__r.") + 4;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var end = field.length - start;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(end);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; field = field.substr(start,end);<br>
&nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; &nbsp; var trim__c = field.replace("__c","");<br>
&nbsp; &nbsp; &nbsp; &nbsp; var trim_ = trim__c.replace(/_/g," ");<br>
&nbsp; &nbsp; }<br>
&nbsp; &nbsp; return trim_;<br>
}<br>
//then just call it<br>value1 = fixFieldFormat(value1);