Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created an External Content Type in my Sharepoint 2010 installation that gets its data through a WCF Service from a remote database. I have implemented all the CRUD operations without issue.

I have created a list instance in Visual Studio 2010 and I have added a custom newform to the instance so when a user selects New Item while browsing the list my custom form is the one used. This works well. However when a user inputs data for a new item and presses Save I need to be able to return to the user any errors that might arise from the external system.

I can't figure out how to get an event or handle to the BDCModel in my code behind of my custom form that will allow me to post back an error if for instance the WCF Service times out or the remote database is not available for some reason.

Governance has declared that we are not allowed to use the Sharepoint Designer or InfoPath forms to I have to do this in Visual Studio.

Can anyone point out tutorials for intercepting errors returned from BDCModel Create and Update methods and posting them back to the user through the code behind of my custom form or do I have to implement the entire save procedure myself with a totally custom form that overrides the Save?

I would rather not have to do that. I have also been told that I cannot use a custom webpart to implement this with the client object model unless there is absolutely no way to solve this using the OOTB external list and custom forms.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Our only option was to create a base class for our custom forms to inherit from. Then we overrode the page error event and when we recieve an error back from a service call I simply redirect the page back to itself and append the errormessage to the query string.

When the page loads if the errormessage is present I place the string into a label that I have added to all the custom CRUD pages. Not elegant, but it works.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.