Accessing BCS External Data From An App For SharePoint 2013

Accessing BCS External Data can be difficult!

WP_000195-e 1346989263331

If you are creating an App for SharePoint 2013 and plan to access
BCS external data by using the REST API to query an external list,
keep in mind that you must package your External Content Type in
the SPAPP as well. If you do not, you will see this error returned
by your request to the REST service:

Access denied. You do not have permission to perform this
action or access this resource.

And you will see this error in the ULS logs when the query attempts
to execute.

System.UnauthorizedAccessException: Apps cannot use
External Content Types defined in the Business Data Connectivity
Shared Service Application metadata catalog. Apps should package
any External Content Type definitions in a BDC model file which is
packaged and deployed as part of the SharePoint App.

If you try to use the CSOM Javascript API you will get an error
similar to this one:

The metadata catalog file
BusinessDataMetadataCatalog/BDCMetadata.bdcm could not be found on
the site
http://app-cbb5c08e54bb2a.apps.powder.ski/BCSExternalDataSPApp.

 

This article was first published by Todd
Baginski
. Todd is a six-time Microsoft SharePoint Server
MVP whose blog focuses on Microsoft SharePoint, Office, and mobile
technologies.

 

If you found this blog post interesting, checkout our resource centre for more: https://www.sharepointeurope.com/resource-centre/

Share this on...

Rate this Post:

Share: