vLookup Version History

Home Forums Classic DFFS vLookup Version History

Viewing 4 reply threads
  • Author
    Posts
    • #17687

      Hi,

      I got a list with items and use the vLookup function to reference documents. Is there any chance to also get a button (for each referenced file) to access directly the version history of each file?

      thanks.

    • #17697
      Keith Hudson
      Participant

        Christoph: You can create a calculated field on your list that contains a link to the version history page for an item — this article may help: URL to version history page (Hint: to make it display as a link, set the data type to “number”). Then just display that column where you want to be able to go to the version history.

        If you’re stumped, reply to this answer and I’ll try to get time to create a sample.

        P.S. You may need to research a few things like “How do I get the GUID of a sharepoint list?” “How create a link in a calculated column.”

      • #17714

        Hi Keith,

        I got the link now in my column but I cannot get it to be a hyperlink. can you give any advice? I have set the data type to number,…

        thanks.

      • #17724
        Alexander Bautz
        Keymaster

          Hi,
          Add a new column to the “ViewFields” in vLookup – use the ID column in the “Field”, add “Version history” as display name and add this to the “Special configuration”:

          {"function":"versionHistory"}

          Then add this to the Custom JS – change the path and the GUID to match the one from your list / library:

          function versionHistory(id,item){
              return "<span style='cursor:pointer;' onclick='showVersionHistory(\""+id+"\")'>Version history</a>";
          }
          
          function showVersionHistory(id){
              var url = "/DFFS/_layouts/Versions.aspx?list={ccbbf922-f0af-481b-b2c0-b12ea24d224e}&ID="+id;
              SP.UI.ModalDialog.showModalDialog({"url":url,"allowMaximize":true,"showClose":true});
          }

          This should open the version history for your item.

          Alexander

        • #17788

          Hi,

          many thanks Alexander. This works now perfectly.

          Christoph

      Viewing 4 reply threads
      • You must be logged in to reply to this topic.