Connecting Lists in a Webpart RRS feed

  • Question

  • I've connected my Parent List to my Child List in the view and edit screens, but also want the Child List to show the Parent List in the view and edit. Is this possible? I've tried many different combinations and couldn't the Parent List to show with the Child.



    Thursday, February 9, 2017 12:56 PM


  • Hi,

    I think you could get related parent list item by jsom in view/edit form, below is sample code for your reference.

     <script src="" type="text/javascript"></script>
        <script type="text/javascript">
            $(function () {
                ExecuteOrDelayUntilScriptLoaded(getCurrentListItem, "sp.js");
            function getCurrentListItem() {
                var context = SP.ClientContext.get_current();
                var web = context.get_web();
                var currentList = web.get_lists().getById(_spPageContextInfo.pageListId);
                var currentListItem = currentList.getItemById(getQueryStringParameter("ID"));
                function (object,sender) {
                   var ParentItemID=currentListItem.get_item('LKP').get_lookupId();
            function getQueryStringParameter(paramToRetrieve) {
                var params = document.URL.split("?")[1].split("&");
                for (var i = 0; i < params.length; i = i + 1) {
                    var singleParam = params[i].split("=");
                    if (singleParam[0] == paramToRetrieve) return singleParam[1];

    Best Regards,


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Friday, February 10, 2017 2:55 AM