Reply To: Show additional information on multilookup items in DispForm

Forums Dynamic Forms for SharePoint Show additional information on multilookup items in DispForm Reply To: Show additional information on multilookup items in DispForm

#30483
Mike
Participant

Revised JS

`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”,”TNDate”]
});
var b = [];
b.push(“<br>TNDecision: ” + item.TNDecision);
b.push(“TNPOC: ” + (item.TNPOC !== null ? item.TNPOC : “”));
b.push(“TNDate: ” + new Date(item.TNDate.split(” “).join(“T”)).toLocaleDateString());
jQuery(a).append(b.join(“<br>”));
});
// Separate each item
jQspjs(“#dffs_TNLookup .ms-formbody”).contents().filter(function () {
return (this.nodeType === 4 && this.nodeValue === “; “);
}).replaceWith(“<hr>”);’

Gives me this error in the Display form when launching

DFFS: There is an error in the Custom JS textarea:
*************************************
TypeError: item.TNDate is null
*************************************
Please enter setup and revise.

The Display form then has incorrect formatting as shown in attached screen shot.

Mike