Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 36188

Custom CRUD forms break when list schema changes

$
0
0

Symptom

A customer has a list with custom New, Edit and Display .aspx forms. The customer later changes the name of a column or removes a column. This changes in the list schema, then you get an error that there is something wrong with the query the next time you try to open the forms to edit them.

Cause

I believe the schema change invalidates the embedded query in the .aspx pages.

Solution

Create new temporary New, Edit and Display forms. Scroll to the <DataSources> element and copy it. Paste it in the corresponding section in the original New, Edit and Display Forms. Save the web pages. The new data query should work.

 

<DataSources>
<SharePoint:SPDataSourcerunat="server"DataSourceMode="ListItem"SelectCommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;ContentType&quot;/&gt;&lt;Value Type=&quot;Text&quot;&gt;Issue&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;"UseInternalName="True"UseServerDataFormat="True"><SelectParameters><WebPartPages:DataFormParameterParameterKey="ListItemId"PropertyName="ParameterValues"DefaultValue="0"Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="weburl"PropertyName="ParameterValues"DefaultValue="http://TheSite"Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="ListID"PropertyName="ParameterValues"DefaultValue="{18873E6C-FF3E-4534-8055-23FAE05DEAAC}"Name="ListID"></WebPartPages:DataFormParameter>
</SelectParameters><UpdateParameters><WebPartPages:DataFormParameterParameterKey="ListItemId"PropertyName="ParameterValues"DefaultValue="0"Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="weburl"PropertyName="ParameterValues"DefaultValue="http://TheSite"Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="ListID"PropertyName="ParameterValues"DefaultValue="{18873E6C-FF3E-4534-8055-23FAE05DEAAC}"Name="ListID"></WebPartPages:DataFormParameter>
</UpdateParameters><InsertParameters><WebPartPages:DataFormParameterParameterKey="ListItemId"PropertyName="ParameterValues"DefaultValue="0"Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="weburl"PropertyName="ParameterValues"DefaultValue="http://TheSite"Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="ListID"PropertyName="ParameterValues"DefaultValue="{18873E6C-FF3E-4534-8055-23FAE05DEAAC}"Name="ListID"></WebPartPages:DataFormParameter>
</InsertParameters><DeleteParameters><WebPartPages:DataFormParameterParameterKey="ListItemId"PropertyName="ParameterValues"DefaultValue="0"Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="weburl"PropertyName="ParameterValues"DefaultValue="http://TheSite"Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameterParameterKey="ListID"PropertyName="ParameterValues"DefaultValue="{18873E6C-FF3E-4534-8055-23FAE05DEAAC}"Name="ListID"></WebPartPages:DataFormParameter>
</DeleteParameters>
</SharePoint:SPDataSource>
</DataSources>

Viewing all articles
Browse latest Browse all 36188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>