Required Field/FieldRef Content Type not working correctly for currency

sharepoint

I have the following field specified in my ContentType xml for a currency field. Any other required field in the content type works as expected for the list bar this one, it doesn't show as required. I really can't see what is wrong, can anyone help please?

<Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Currency" Decimals="2" Min="0" Required="TRUE" Group="MyGroup" ColName="Price"/>

...

<ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c"
           Name="MarketPlaceContentType"
           Group="MyGroup"
           Description="Market place item, holds Title, Description, Category etc"
           Inherits="FALSE"
           Overwrite="TRUE"
           Version="0">


<FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="TRUE" />    

Best Answer

i'm working on this with Burt and can share a bit more light on the issue, guidance on what we are doing wrong would be great!!

1) We've created a content type.

E.g

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

    <Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Text" Required="False" Group="" ColName="Price" StaticName="Price" />

    <!-- Parent ContentType: Item (0x01) -->
    <!-- set  Inherits="FALSE" so the new template is picked up-->
    <ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c"
                 Name="MarketPlaceContentType"
                 Group=""
                 Description="Market place item, holds Title, Description, Category etc"
                 Inherits="FALSE"
                 Version="0">
        <FieldRefs>
            <FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="TRUE" />
        </FieldRefs>
    </ContentType>
</Elements>

2) We've created a list definition using this content type

<

?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Lists - MarketPlace" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Lists-MarketPlace"
      BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/" NavigateForFormsPages="False" DisableAttachments="true" BrowserFileHandling="permissive" EnableContentTypes="TRUE">
    <MetaData>
        <ContentTypes>
            <ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c" Name="MarketPlaceContentType"
                         Group="" Description="Market place item, holds Title, Description, Category etc" >
                <FieldRefs>
                            <FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="true" />
                   </FieldRefs>
            </ContentType>
        </ContentTypes>
        <Fields>
            <Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Text" Required="True" Group="" />
        </Fields>
        <Views>
            <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
                <Toolbar Type="Standard" />
                <XslLink>main.xsl</XslLink>
                <RowLimit Paged="TRUE">30</RowLimit>
                <ViewFields>
                    <FieldRef Name="LinkTitleNoMenu">
                    </FieldRef>
                </ViewFields>
                <Query>
                    <OrderBy>
                        <FieldRef Name="Modified" Ascending="FALSE">
                        </FieldRef>
                    </OrderBy>
                </Query>
                <ParameterBindings>
                    <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
                    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
                    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
                </ParameterBindings>
            </View>
            <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE"
                  MobileDefaultView="TRUE"
                  SetupPath="pages\template\marketpgviewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx" >
                <Toolbar Type="Standard" />
                <XslLink Default="TRUE">main.xsl</XslLink>
                <RowLimit Paged="TRUE">10</RowLimit>
                <ViewFields>
                    <FieldRef Name="MarketplaceCategories" DisplayName="Category"></FieldRef>
                    <FieldRef Name="LinkTitle" DisplayName="Title"></FieldRef>
                    <FieldRef Name="Author" DisplayName="Name" />
                    <FieldRef Name="Created" Format="DateOnly"  DisplayName="Date"/>
                    <FieldRef Name="Locations" DisplayName="Location"></FieldRef>
                    <FieldRef Name="MarketplaceItemExpiryDate" DisplayName="Expiry Date" Format="DateOnly"></FieldRef>
                </ViewFields>
                <Query>
                    <OrderBy>
                        <FieldRef Name="ID" Ascending="False" />
                    </OrderBy>
                </Query>
                <ParameterBindings>
                    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
                    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
                </ParameterBindings>
            </View>
            <View BaseViewID="2" Type="HTML" WebPartZoneID="Main" DisplayName="Items By Category" DefaultView="false" MobileView="TRUE"
                  MobileDefaultView="TRUE"
                  SetupPath="pages\template\marketpgviewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="ItemsByCategory.aspx" >
                <Toolbar Type="Standard" />
                <XslLink Default="TRUE">main.xsl</XslLink>
                <RowLimit Paged="TRUE">10</RowLimit>
                <ViewFields>
                    <FieldRef Name="LinkTitle" DisplayName="Title"></FieldRef>
                    <FieldRef Name="Price"/>
                </ViewFields>
                <Query>
                    <Where>
                        <Eq>
                            <FieldRef Name="MarketplaceCategories" />
                            <Value Type="Text">{MarketplaceCategories}</Value>
                        </Eq>
                    </Where>
                    <OrderBy>
                        <FieldRef Name="Created" Ascending="False" />
                    </OrderBy>
                </Query>
                <ParameterBindings>
                    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
                    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
                    <ParameterBinding Name="MarketplaceCategories" Location="Control(tcCategories, SelectedItem)"/>
                </ParameterBindings>
            </View>


        </Views>
        <Forms>
            <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main"/>
            <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
            <Form Type="DisplayForm" Url="CustomDisplayForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\MarketPlace\displayitem.aspx" UseLegacyForm="true" WebPartZoneID="Main" Template="MarketPlaceDisplayForm"/>
        </Forms>
    </MetaData>
</List>

3) Our content types have various fields that we want to amend their attributes but we are unable to update them easily.

Any pointers on what we are doing wrong would be great !!!!

Related Topic