locked
CRM displaying account folder from Sharepoint based on account name RRS feed

  • Question

  • Below is based on the following website: http://blogs.msdn.com/crm/archive/2007/04/18/integrating-windows-explorer-files-and-folders-into-crm-tabs.aspx
    We are trying to add an iframe to a tab called Documents in the account entity that automatically loads the documents for that account.  Right now when you load the account form for a particular account it will display the "root" folder but not the specific account folder.  When checking the properties of the iframe it shows the url as:

    http://crm.companyname.com/custom/fileviewer/default.aspx?FolderName=CustomerX


    I believe the on load is correct:

    var FolderName = crmForm.all.name.DataValue;
    {
        if (FolderName != null)
       {
            document.all.IFRAME_sharepoint.url=" /custom/fileviewer/default.aspx?FolderName=" + FolderName;
        }
    else
        {
            document.all.IFRAME_sharepoint.url="about:blank";
        }
    }

    We also have the default.aspx page with a script, I have left out our companies server names:

    <HTML xmlns:o="urn:schemas-microsoft-com:office:office" dir="ltr">

    <HEAD>

    <meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta HTTP-EQUIV="Content-Type"

    content="text/html; charset=utf-8" /><meta HTTP-EQUIV="Expires" content="0" />

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

    <BODY>

    <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" Height="100%">

    <td valign="top"><div WebPartID="9df1e1c0-1214-4744-aeff-1d573870e4a7" id="WebPartWPQ2" width="100%">

     <iframe title="Fileviewer" frameborder="0" id="MSOPageViewerWebPart_WebPartWPQ2" name="MSOPageViewerWebPart_WebPartWPQ2" width="100%"  height="100%"

    src="\\ServerName\ParentDirectory\" ddf_src="\\\ServerName\ParentDirectory">

     </iframe>

    </div></td></table>

    <script>

        document.all.MSOPageViewerWebPart_WebPartWPQ2.src+FolderName;

    </script>

    </BODY>

    </HTML>

    Any ideas?

    Tuesday, March 2, 2010 4:12 PM

Answers

  • Remove the script block and add the folder name from the querystring into the src with a bit of server side code like this

    src="\\ServerName\ParentDirectory\<%=Request.QueryString["FolderName"]%>" ddf_src="\\ServerName\ParentDirectory\<%=Request.QueryString["FolderName"]%>"> 

     



    @_Simon_Jackson http://www.simonjackson.info/ MBCS MCBMSS MCBMSP MCSD MCDBA MCAD MCSA
    • Edited by _Simon_Jackson Tuesday, March 2, 2010 10:04 PM originally incorrect answer
    • Proposed as answer by _Simon_Jackson Wednesday, March 3, 2010 9:48 PM
    • Marked as answer by Jim Glass Jr Friday, March 5, 2010 9:17 PM
    Tuesday, March 2, 2010 9:14 PM

All replies

  • Remove the script block and add the folder name from the querystring into the src with a bit of server side code like this

    src="\\ServerName\ParentDirectory\<%=Request.QueryString["FolderName"]%>" ddf_src="\\ServerName\ParentDirectory\<%=Request.QueryString["FolderName"]%>"> 

     



    @_Simon_Jackson http://www.simonjackson.info/ MBCS MCBMSS MCBMSP MCSD MCDBA MCAD MCSA
    • Edited by _Simon_Jackson Tuesday, March 2, 2010 10:04 PM originally incorrect answer
    • Proposed as answer by _Simon_Jackson Wednesday, March 3, 2010 9:48 PM
    • Marked as answer by Jim Glass Jr Friday, March 5, 2010 9:17 PM
    Tuesday, March 2, 2010 9:14 PM
  • Sorry I am just now getting back to this.  I have followed your suggestion and I do see the link in the iframe = http://crm.company.com/custom/fileviewer/default.aspx?FolderName=Target Customer

    However I am still only seeing the root directory not the customer's folder.  The folders are named exactly as their account names.
    Thursday, March 11, 2010 12:49 AM
  • Remove the script block and add the folder name from the querystring into the src with a bit of server side code like this

     

     


    src="\\ServerName\ParentDirectory\<%=Request.QueryString["FolderName"]%>" ddf_src="\\ServerName\ParentDirectory\<%=Request.QueryString["FolderName"]%>"> 

    @_Simon_Jackson http://www.simonjackson.info/ MBCS MCBMSS MCBMSP MCSD MCDBA MCAD MCSA

    I apologize this has corrected our issue and we Thank you Very Much!!!

    I had put this on our live box but the live box was not on the same network as the servers.  Meant to do this on the dev box which would have worked.
    Thursday, March 11, 2010 5:19 PM
  • One last question how would we search sub folders? In other words we are searching for the customer name to match the folder name but our folders are sorted by letters.  ex: \\servername\share\customers\a  or \\servername\share\customers\b and so on down the alpabet.  Is there a way to drill down to the other folders?
    Thursday, March 11, 2010 5:22 PM