Kinderdijk

In SharePoint Designer 2007 I¡¯m trying to customize the edit form that you get when you create a list item in a SharePoint 2007 list (EditForm.aspx). I took the following steps:

1. Open the site in SharePoint Designer 2007.

2. Browse to the list and open the ¡®NewForm.aspx¡¯ web form.

3. Save this list as ¡®customNewForm.aspx¡¯.

4. Delete the default List Form Web Part from the page.

5. Insert a Custom List Form: Insert > SharePoint Controls > Custom List Form

6. In the List or Document Library Form dialog, select the appropriate list, content type and type of form.

7. Click Ok. The new Data Form Web Part is added to the page.

8. Save the Site.

I didn¡¯t do any customizations yet. I only inserted the new listitem form on the page and saved it.

Now when I want to create a new listitem in my browser the newform.aspx-page opens correctly. Only when I hit the ¡®OK¡¯-button I receive the following error:

¡°The data source control failed to execute the insert command¡±

It seems that something goes wrong when inserting the new data in the list. Can someone help me out with this



Re: SharePoint - Development and Programming The data source control failed to execute the insert command

fedroponce

Today I faced a similar situation. Although my customized NewForm2.aspx worked just fine (I followed the same steps depicted in your post too), when I created a customized EditForm2.aspx (based either on the NewForm.aspx or the EditForm.aspx for my custom list) I found that trying to edit a list item yielded the same error...

¡°The data source control failed to execute the update command¡±

After a lot of debugging (read trial-and-error) by adding and deleting fields to the forms I narrowed the problem to the Form's DateTime Fields. This is, whenever the form included a Field that was rendered as a DateTime Picker control by the built-in SharePoint FormField controls used by default, the error appeared.

So I dedicded to change those auto-generated FormField controls to DateTime Picker controls by manually editing the code (or better by clicking on the '>' smart-icon for the field and choosing the DateTime Picker instead of the defautl form field control.

After that, I tested my EditForm2.aspx form and it worked fine. The form renders exaclty the same... but the control is not infering the rendered control type from the List Field Type... it seems to me that there is a bug on this controls.

Hope this helps.





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

Kinderdijk

I'm using a Dutch version of MOSS 2007. So I figured that there is something going wrong when converting to the Dutch DateTime-standard (dd-mm-yyyy). What version are you using

It's clear that the problem is caused by DateTime fields.





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

fedroponce

I am using an Spanish localized version of MOSS 2007.

We found the same problem for either New, Edit or Display Custom Forms. We had to change the default generated controls for DateTime controls.

Did your set up worked this way





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

Kinderdijk

I wanted to test your solution, so I created a new List, with just the fields 'Title' and 'DateTime'.

First I modified the NewForm and didn't change the DateTime field. The strange thing is that when I created a new item in the List, nothing went wrong (the error used to appear here) and the item is correctly stored in the List.

After that I also changed the default control into a DateTime control. Creating a new item in the List also works fine with this control.

I really don't know why the error doesn't appaer anymore. The only thing I can think of is that I didn't use a sitecolumn this time. I don't really have time to dig into this issue at the moment, but I will have another look at it in a couple of weeks. I'll post my findings.

Did you customized your New, Edit and Display Forms with the DateTime controls Does everything still works correctly in the List and not having any other problems Did you use sitecolumns





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

fedroponce

We found that in a custom NewForm.aspx the problem did not occur... but creating a customized NewForm.aspx yielded the problem until we edited the form and changed to DateTime controls.

-->Did you customized your New, Edit and Display Forms with the DateTime controls

Yes

-->Does everything still works correctly in the List and not having any other problems

Not yet... it's been a couple of days since we edited the customized forms to include the DateTime controls. Appart from stopping the error, we have found no side effects so far. Our customized forms include several columns (around 30), 10 of them are dates, sevelar lookups, Multiline Edits and text columns... none of them have misbehaved.

We hope that the problem is only with the DateTime columns.

-->Did you use sitecolumns

Yes, in some columns of the lists





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

schapman

i've been experiencing a similar error (the datasource failed to execute the insert command) on a SP Designer created workflow. it seems my particular case was because of 'old' instances of the workflow hanging around - all i did to fix it up was go in to the List Settings, Workflow Settings, click Remove a Workflow link and remove all instance of the workflow. Then re-attach the workflow using SPD.

not sure if this will help you guys out but it certainly did me...





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

fedroponce

We are still facing problems with the DateTime Controls in our customized Edit Forms.

If during initial creation of the item using the customized New form the DateTime fields are not captured (left blank), then using the customized edit forms yields the error. It does not matter if the DateTime fields are captured or no... the form fails to update the item

But, if during initial creation the DateTime columns are captured, the Edit Form works... but with two problems.

First, there is no way to "blank" the DateTime columns again... it will either raise the error or, will update the item but the "cleared" DateTime columns will remain with their previous value.

I will double-check on the workflow issue again (since our list does include a workflow) but the list has been recreated at least two times and the customized edit forms still break.

Today I added an ItemAdding handler to my list (since I needed to comply with some business logic that needed to be processed before the insertion... I will be testing for the value in the AfterProperties for these DateTime columns just to check if the event handler is fired before the actual error occurs.

I'll post my findings then.





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

fedroponce

We opened a support ticket with Microsoft... the bottom line:

It is a known bug, there is no curren hot-fix or work-around. It might be solved with Service Pack 1 whenever it is released. In the meantime.... well.. bad luck.. you know.




Re: SharePoint - Development and Programming The data source control failed to execute the insert command

sercan

Does anyone know if this has been fixed on SP1

Can not create NewForm.aspx, getting error "The data source control failed to execute the insert command."

EDIT: I didnt read the 'Date Picker' bit. FIXED





Re: SharePoint - Development and Programming The data source control failed to execute the insert command

Skibutt

In short, No !
I've just started having this problem and i'm running SP1.

I have multiple date fields in a list but only a couple of which that cause this problem.

I've tried using the date picker but in designer i then get...
When setting as date only > Error Rendering Control - does not have a public property named xat-id

or when submitting the form > The data source control failed to execute the update command.

Grrrr : (