Reply To: Show additional information on multilookup items in DispForm

Forums Classic DFFS Show additional information on multilookup items in DispForm Reply To: Show additional information on multilookup items in DispForm

#30497
MikeS
Participant

I keep getting an [empty] date returned with this mod. See screen shot.

Script:

jQspjs(“#dffs_TNLookup .ms-formbody a”).each(function (i, a) {
var id = GetUrlKeyValue(“ID”, false, a.href);
var listId = GetUrlKeyValue(“ListId”, false, a.href);
var item = spjs.utility.getItemByID({
“listName”: listId,
“id”: id,
“viewFields”: [“TNDecision”,”TNPOC”,”123Date”]
});
var TNDecision = item.TNDecision;
if(TNDecision === null){
TNDecision = “[empty]”;
}
var TNPOC = item.TNPOC;
if(TNPOC === null){
TNPOC = “[empty]”;
}
var Date123 = item[“123Date”];
if(Date123 === null){
Date123 = “[empty]”;
}else{
Date123 = new Date(item[“123Date”].split(” “).join(“T”)).toLocaleDateString();
}
var b = [];
b.push(“TNDecision: ” + TNDecision);
b.push(“TNPOC: ” + TNPOC);
b.push(“123Date: ” + Date123);
jQuery(a).append(“<div>” + b.join(“<br>”) + “/<div>”);
});
// Separate each item
jQspjs(“#dffs_TNLookup .ms-formbody”).contents().filter(function () {
return (this.nodeType === 3 && this.nodeValue === “; “);
}).replaceWith(“<hr>”);

One other thing: I had to remove the ‘/’ before the closing div or it would appear in the UI. Doesn’t seem like a good work-around due to markup standards. You can see the ‘/’ in the attached screen shot.

Mike