We have a Sharepoint 2013 site, with lists for People, and Applications.
When we click on a person record to 'view' their person details (the default People list Display Form) - we have added a list web part to show the 'related' items from the Applications list.
The Applications list has several content types representing the different types of applications - each of which has different columns that are required.
We are currently able to click a hyperlink to open a new 'item' from the Applications list and have it pass through the related_person_id. What we are missing is how to construct the hyperlink to open a specific content type when clicked.
Here is the current script we are using to identify the person id, and then find a hyperlink, and replace it with one that appends the related_person_id field value:
<!-- Name: DisplayRelatedPeople.js -->
//get the ID for the Issue from the Query String
var issueID = getParameterByName("ID");
//find the element with the "New Application" link.
//note that if you have more than one list on your page, this just finds the first one
var anchorElement = $("a:contains('New App')");
" + issueID + "');");
// The following function should really be put into a utility library
// with all of your commonly called functions
// no, I didn't write this function from scratch, I found it at
name = name.replace(/[\/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location
if(results == null)
e(/\+/g, " "));