none
HELP: Need a list VIEW showing a field's LAST APPENDED ENTRY - versioning turned on RRS feed

  • Question

  • I need to create a list VIEW that shows the LAST APPENDED ENTRY for a field - versioning is on.

    Right now, if I select the field for a view, all I see are three (3) dots indicating that there are multiple entries for this field.
    What I want to see is the LAST ENTRY MADE so that the view provides more useful information.

    Can I do this with SharePoint out of the box? 
    Or do I need to use SharePoint Designer?

    Whichever is the correct answer, please provide instructions.  I'm not that strong of a developer.

    My email is:  diane@soundwayconsulting.com

    THANK YOU

    Thursday, March 30, 2017 5:46 PM

All replies

  • Hi,

    We can use some JavaScript code to achieve it, modify the code below(replace the "Comment" to your field name) and add the following code into a script editor web part in the list view page.

    <script src="//code.jquery.com/jquery-3.1.0.min.js" type="text/javascript"></script>
    <script type=text/javascript>
    (function () {
        var commentsFieldCtx = {};
        commentsFieldCtx.Templates = {};
        commentsFieldCtx.Templates.Fields = {
            "Comment": {
                "View": ViewLastAppendedEntry 
            }
        };
        SPClientTemplates.TemplateManager.RegisterTemplateOverrides(commentsFieldCtx);
    })();
    function ViewLastAppendedEntry(ctx) {
       var itemId=ctx.CurrentItem.ID;
       var listTitle=ctx.ListTitle;
       var comments=GetLastAppendedEntry(listTitle,itemId);
       return comments;
    }
    function GetLastAppendedEntry(listTitle,itemId){
    
    	var commentValue="";
    	$.ajax({
    		url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('"+listTitle+"')/items("+itemId+")",
    		method: "GET",
    		async: false,
    		headers: { "Accept": "application/json; odata=verbose" },
    		success: function (data) {
    			commentValue=data.d.Comment;			
    		},
    		error: function (data) {
    			//failure(data);
    		}
    	});
    	return commentValue;
    }
    </script>
    

    Or your can try to use SharePoint designer to achieve it.

    Get rid of 'View Entries' in a SharePoint 2013 Append-Only Column in a View

    https://www.brightwork.com/blog/show-content-sharepoint-2013-append-rtf-column-view#.WN4F2uRMSM8

    Best Regards,

    Dennis


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

    Friday, March 31, 2017 8:18 AM
    Moderator