Friday, May 8, 2009

Modify the fields order into New and Edit form of a list

If you have created a list and want for some reasons to change the order of the fields into the New or Edit form you can do this using the interface or at list creation time, using the schema.xml.

Using the interface you have to go to “List Settings” -> “Columns” -> “Column ordering” if your list has not content type enabled or “Settings” -> “Content Types”-> click on used content types -> “Columns” -> “Column order” in the other case.

If you want to do this using schema.xml you have to go in the <ContentTypes> tag and get the ID of the referenced content type. Using this ID go to the part that describe your contenttype and referenced fields. The fields order is decided by declaration order. For example if we have:

<FieldRefs>
<FieldRef ID="{BAA1289C-E3B8-11DD-95C8-C09456D89593}" Name="Field1" DisplayName="Field1" />
<FieldRef ID="{E7CD97AA-E3B8-12DD-861B-5F9656D89593}" Name="Field2" DisplayName="Field2" />
<FieldRef ID="{B2AB2191-2376-4B2C-938A-74AA4D14FF36}" Name="Field3" DisplayName="Field3" />
</FieldRefs>



Then the fields order will be Field1, Field2, Field3. Now change the declaration order and you will see that the fields order will be changed also.



If we do not use content types and still want to customise the fields order seems that a default content type is used and the name for this is “Item”. Since this is a customisation I think you have to declare a new content type and do the steps from above.



Another way can be to create your own customized page for New and Display.

No comments:

Post a Comment