display a link to a lookup field on an edit form

Forums SPJS-Lookup display a link to a lookup field on an edit form

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 8 months, 1 week ago.

  • Author
    Posts
  • #14506

    Jeff Lynch
    Participant

    I have a Acknowledgement list, it links a user with a document from a separate list and asks them to edit the form and click the “I agree” button. I’d like the edit form to have the hyperlink to the document in it, is this possible?

  • #14547

    Alexander Bautz
    Keymaster

    Add the field “FileDirRef” to the ViewFields section in vLookup, and add this to the “Special configuration”:

    {"function":"buildLinkToDocument"}

    Then add this to the Custom JS:

    function buildLinkToDocument(a,b){
        return "<a href='"+b.get_item("FileDirRef")+"/"+b.get_item("FileLeafRef")+"' target='_blank'>Link</a>";
    }

    See attached images for details.

    Alexander

You must be logged in to reply to this topic.