Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Updating SPField.SchemaXml causes an update to the WSS database and does not update properties.


Author: Robert Bogue MVP

View products that this article applies to.

Symptoms

If the SchemaXml field is updated and later a SPField.Update() method call is performed the changes made to the field via SPField.SchemaXml are lost.

↑ Back to the top


Cause

SchemaXml causes an update to be performed to the database to record the changes, however, the other properties of the field are not updated�to reflect the changes made.� A subsequent .Update() method call overwrites the SchemaXml changes with the previous data.

↑ Back to the top


Resolution

Do not call .Update() after upading SchemaXml and do not use the SPField object any longer.� If you need to continue using the same SPField, fetch it from the SPFieldCollection (fields) on the SPList object again.

↑ Back to the top


More information

Also, you can not change the InternalName of a field with SchemaXml.� The InternalName of the old SchemaXml and new SchemaXml must match.

↑ Back to the top


Community solutions content disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.

↑ Back to the top


Keywords: KB555293, kbhowto, kbpubtypecca, kbpubmvp

↑ Back to the top

Article Info
Article ID : 555293
Revision : 1
Created on : 4/21/2005
Published on : 4/21/2005
Exists online : False
Views : 271