Display Attchments of Child item in vLookup

Forums vLooup for SharePoint Display Attchments of Child item in vLookup

This topic contains 3 replies, has 2 voices, and was last updated by  Alexander Bautz 1 week, 4 days ago.

  • Author
    Posts
  • #17592

    Craig Campbell
    Participant

    I am trying to implement some code I found in your blog. When I setup the form and vLookup as attached, it shows the “Attachment” as clickable but nothing comes up.

    Attached are screens shots of my setup in DFFS as well as what the form looks like.

    Thanks for your help Alexander

  • #17632

    Alexander Bautz
    Keymaster

    Not sure if you have already done this in your code, but you must edit the code and change the name of the list.

    If you have already done this, open the dev tools by hitting F12 > Console and look for error messages there.

    Alexander

  • #17642

    Craig Campbell
    Participant

    Yes I had already done that. I guess I took the snapshot before I made the change.

    After hitting F12 I found 4011 error accessing SPJS library. When I went in there I could not see anything. I received a Web Part Error.

    Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe. Correlation ID: d0100c9e-22e8-b0b1-cdfb-d4c838375edf.

    I just upgraded this site to 4.41

  • #17722

    Alexander Bautz
    Keymaster

    Sorry for the late reply – my inbox have been a bit flooded lately.

    It’s unfortunately hard to tell what it could be without looking at it. Is it possible for me to log in and look at it?

    If not, could you post (or email me if you don’t want the pictures online) a few screenshots of the errors you receive?

    PS: You can insert a console.log statement in the script like this to see whats going on:

    function initAttachments(a,item){
    console.log(item);
    	if(item.get_item("Attachments")){
    ...
    ...
    ...
    function getAttachments(id){
    var url = _spPageContextInfo.webServerRelativeUrl+"/_api/lists/getByTitle('The DisplayName of your list')/items?$filter=Id eq "+id+"&$select=AttachmentFiles,Title&$expand=AttachmentFiles";
    	$.getJSON(url, 
    		function(data) {
    console.log(data);
    			var b = [];
    ...
    ...
    ...		

    You are using SP 2013+? – if not, you should find a SP 2010 code example in the same forum post.

    Alexander

You must be logged in to reply to this topic.