locked
Content organizer, managed metadata and BCS external data RRS feed

  • Question

  • Hi,

    We currenlty have SPS2010 connecting to CRM 4.0 via BCS, populating custom site columns with client and project information.

    We want to batch upload a few thousand documents and apply hierachical metadata (client > project) upon upload - then route (using the content organizer) the docs to the appropriate library based on the metadata applied.

    So, what I need to know is;

    • Can we populate the managed metadata automatically via the BCS connection to CRM?
    • Can we then apply (on mass) that metadata to document uploaded?

    Thanks

    Wednesday, June 30, 2010 12:24 PM

Answers

  • Hi n_tag09,

    For the last part you could use PowerShell to upload multiple document and set the meta-data properties on the fly. Example script to load content and set data:

    $docliburl=”http://BC01/17_06_2010”
    $relweburl=”/”
    [System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”) > $null
    $site=new-object Microsoft.SharePoint.SPSite($docliburl)
    $web=$site.openweb($relweburl)
    $folder=$web.getfolder($docliburl)
    $list=$web.lists[$folder.ContainingDocumentLibrary]
    
    $propbag=@{”ContentType”=”Document”
            “Product” ="Your value goes here..." }
    
    $bytes=get-content -Encoding byte $docname
    $bytes=[byte[]]$bytes
    $folder.files.Add($docname,$bytes,$propbag, $true) > $null

     

    Replace $docname with the filename you want to upload....

     

    I hope this helps....


    Brian C | Blog Site

    Thursday, July 1, 2010 3:07 PM

All replies

  • Hi n_tag09,

    For the last part you could use PowerShell to upload multiple document and set the meta-data properties on the fly. Example script to load content and set data:

    $docliburl=”http://BC01/17_06_2010”
    $relweburl=”/”
    [System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”) > $null
    $site=new-object Microsoft.SharePoint.SPSite($docliburl)
    $web=$site.openweb($relweburl)
    $folder=$web.getfolder($docliburl)
    $list=$web.lists[$folder.ContainingDocumentLibrary]
    
    $propbag=@{”ContentType”=”Document”
            “Product” ="Your value goes here..." }
    
    $bytes=get-content -Encoding byte $docname
    $bytes=[byte[]]$bytes
    $folder.files.Add($docname,$bytes,$propbag, $true) > $null

     

    Replace $docname with the filename you want to upload....

     

    I hope this helps....


    Brian C | Blog Site

    Thursday, July 1, 2010 3:07 PM
  • Hi Brian,

    Thanks this is so helpful! Have you got an idea on how I can populate the metadata properties with values the user selects from an external list site column?

    Again, thanks.

    Tuesday, July 6, 2010 8:49 AM
  • I built a simple console application and a schedule job to auto populate a term store from a SQL Database. Here is a blog post with the code:

    http://www.jondack.com/index.php/2012/08/01/populating-a-sharepoint-taxonomy-term-store-with-sql-data/

    • Proposed as answer by Jon Dack Friday, August 3, 2012 1:06 PM
    Friday, August 3, 2012 1:06 PM