Thursday, January 29, 2015

Get Current Item List Link in JS using Client Side Object Model - Sharepoint 2013

Applicable for Sharepoint 2013

Code
    var Itemlink = ctx.CurrentItem["FileDirRef"];
    var ItemID = ctx.CurrentItem["ID"];
    var finalurl = Itemlink + "/Forms/DispForm.aspx?ID=" + ItemID;

This finalurl is a link
Ex:
http://testsite/sites/TestContentType/Recognition/Forms/DispForm.aspx?ID=1

No comments: