PROGRAMMING WITH EXTERNAL LISTS IN SHAREPOINT ONLINE



SANDBOXED SOLUTIONS

Especially using the sanboxed object model to program against  external lists in SPO  sounds promising. Just imagine, event receivers and workflow actions that can access external systems through an external list. I was really excited! But the disillusionment followed soon. It seems you can’t connect external systems in SPO via BCS from within sandboxed solutions! 
If I try to programmatically access an external list within a sandboxed web part, I get an “The shim execution failed unexpectedly - Access is denied….” exception. 
?
1
2
3
4
5
6
7
8
SPList externalList = SPContext.Current.Web.Lists["Customers"];
foreach (SPListItem externalItem in externalList.Items)
{
  writer.Write(externalList.Item["CustomerID"] + ", ");
  writer.Write(externalItem["CompanyName"] + "
");
}


SNAGHTML8ab405
The sandbox stripes out the user’s security token and this means that the credential mapping (e.g. All Users) defined in the Secure Store Service doesn’t work within in the sandbox. The behavior is described in following MSDN article. The suggested work around is that the managed account that runs the user code proxy service (SPUCWorkerProcessProxy.exe) is mapped to the external credentials.



SNAGHTML886a49

Comments

Popular posts from this blog

SharePoint: Group By on more than 2 columns in a view (SP 2010)

Configure Form Based Authentication (FBA) in SharePoint 2010

SharePoint 2010 Windows PowerShell Interview Questions