Finding out more information when Debugging BCS Errors–BCS Error

In this blog post I just want to show how I go about finding more information when I try to debug SharePoint BCS Errors.

Scenario

We have created our External Content Type, deployed our model and configure a Business Data List Web Part.

Web Part Error

Business Data Connectivity is configured incorrectly. Administrators, see the server log for more information. Correlation ID:66887706-ad9e-409e-9ff8-33c211df28d7

Investigate

Using the ULS Viewer Way

The first thing we should do is to investigate in the logs.

  1. Open ULS Viewer
  2. File > Open From > ULS
  3. It should pick up your SharePoint log-file directory

    Configuring ULS Feed

  4. Click ‘OK’
  5. It should now be monitoring your logs
  6. Click the Filter icon

    Setting Filter in ULS Viewer

  7. Configure the filter like the following
    1. Category equals “Business Data”
    2. Level equals “High”

      Configuring Filter in ULS Viewer

    3. Click OK
  8. Now press Ctrl-x to clear the current log items
  9. Refresh your SharePoint Web Page
  10. Check back in the logs for items matching our filter
  11. I can see the exception here, the correlation token matches so I can be sure this is the right thing which is causing me the trouble. If we click on it we can see more detail

    Viewing errors in ULS Viewer

  12. Now we can see exactly what the issue is and we can begin to investigate our solution.

    There is an error in the TypeDescriptors of Parameters on Method with Name ‘GetAllSupercars’ on Entity (External Content Type) with Name ‘Supercar’ in Namespace ‘LightningTools.TheTestBcsModel.BdcModel1’. The TypeDescriptors incompletely define where the Identifiers of Entity ‘Supercar’ are to be read. That Entity expects exactly ‘1’ Identifiers, but only ‘0’ TypeDescriptors were found from which to read them. 

Using the ULS Logs + Notepad

  1. Open the latest logs from the SharePoint Root Logs folder

    ’C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14LOGS’

  2. Turn off (if not already) Word Wrapping in Notepad from ‘Format’ > ‘Word Wrap’
  3. Perform a Find on your Correlation Token
  4. You will eventually come across a few hits, you should find the ones with a Category of ‘Business Data’ and a Level of ‘High’, in here you should find our error message. It does not look as pretty as the ULS Viewer but it does allow you to find out the detail required.

    SharePoint Log error in Notepad

Using the BCS Tester Man way

For information on how to find errors using BCS Tester Man, check out our video on here:

https://www.lightningtools.com/bcs-tester-man.aspx

<Phill />

Tired of getting BCS errors? Why not try… BCS Meta Man

BCS Meta Man provides the ease of use of a drag and drop interface with the power of Visual Studio. It can save you days in time by generating the code required by SharePoint 2010 to read and write back to your External Systems.