none
How to define Mappings in a custom SPList definition (schema.xml) for a choice field ?

    Question

  • Hi all!

    On this page (http://msdn.microsoft.com/en-us/library/ms459356(v=office.12).aspx), I found that it's possible to define mappings between display values and "stored values". I've tried multiple times without any success... Can anyone help me configuring it correctly or it doesn't work in SharePoint 2007?

    My field definition:

    <Field Name="testField"
    		StaticName="testField"
    		DisplayName="$Resources:myres,Metadata_TestField_Name;"
    		SourceID="http://schemas.microsoft.com/sharepoint/v3"
    		Type="Choice"
    		Required="TRUE"
    		Format="Dropdown"
    		FillInChoice="FALSE"
    		Group="My Columns"
    		Description="Just a sample Field with mappings"
    		ID="{32D096CE-F831-4cdd-9D03-4D225548266D}">
    	<CHOICES>
    		<CHOICE>$Resources:myres,Metadata_True;</CHOICE>
    		<CHOICE>$Resources:myres,Metadata_False;</CHOICE>
    		<CHOICE>$Resources:myres,Metadata_Maybe;</CHOICE>
    	</CHOICES>
    	<MAPPINGS>
    		<MAPPING Value="true">$Resources:myres,Metadata_True;</MAPPING>
    		<MAPPING Value="false">$Resources:myres,Metadata_False;</MAPPING>
    		<MAPPING Value="maybe">$Resources:myres,Metadata_Maybe;</MAPPING>
    	</MAPPINGS>
    	<Default>$Resources:myres,Metadata_Maybe;</Default>
    </Field>
    
    Thanks in advance.
    Tuesday, February 22, 2011 10:07 AM

All replies

  • Hi Nathaire,

    Were you able to configure mappings with the corrensponding choices? If yes, any idea how to use mappings in CAML query?

     

    Please respond. Thanks in advance.

     

    -Hiren.

    Monday, July 04, 2011 11:41 AM