Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

UPDATE: After searching around, it seems what I am looking to change is the identifier for a given entity. Is this done simply by exporting the application definition, changing it and then importing it again? And what are the consequences if the entity is being used in multiple places already?

We have a "Document Type" entity in our site with the following fields:

ID            System.Int32     
Long Name     System.String     
Short Name    System.String

The ID is a numerical unique ID, while the other two are textual representations. The field is always set to show the "Short Name", which is a 2- or 3-letter abbreviation that is easily recognizable and known by all our users.

However, to enter the value directly into the field, without using "Browse", they have to enter the ID (usually a 5-digit integer), which is hard to remember. Is there any way to make the field accept the "Short Name" value without using "Browse"?

Example: I enter "12345", press "Check Names" and the document type short name "PO" shows up correctly. If I enter "PO" directly and press "Check Names" it says "No exact match was found" - I want to accept "PO" as-is without having to press "Browse" and search for it.

This is using SharePoint 2007.

Thanks!

share|improve this question

1 Answer 1

I believe you need to implement a filter descriptor on your entity associated with the "Short Name" type descriptor. You would then set the filter with the IsDefault and UsedForDisambiguation custom properties as shown in the snippet below. That tells the picker control to use the filter for name resolutions as opposed to the entity identifer, which it uses by default.

<Method Name="ReadList">
    <FilterDescriptors>
        <FilterDescriptor Name="ShortNameFilterDescriptor" Type="Wildcard" DefaultDisplayName="Short Name">
            <Properties>
                <Property Name="IsDefault" Type="System.Boolean">true</Property>
                <Property Name="UsedForDisambiguation" Type="System.Boolean">true</Property>
            </Properties>
        </FilterDescriptor>
    </FilterDescriptors>
    <Parameters>
        <Parameter Name="shortName" Direction="In">
            <TypeDescriptor Name="ShortName" TypeName="System.String" AssociatedFilter="ShortNameFilterDescriptor">
                <DefaultValues>
                <DefaultValue MethodInstanceName="ReadList" Type="System.String">%</DefaultValue>
            </DefaultValues>
        </TypeDescriptor>
    </Parameter>
<!-- ... the rest of your app definition ... -->

You can export, change and reimport your app definition. It will update your entities where they're being used.

share|improve this answer
    
Just to be sure, re-importing the updated definition will automatically override the old definition? This sounds like it's exactly what I am looking for. –  Christian P. Feb 13 '12 at 14:20
    
Yes, that's been my experience so far. I am developing in Visual Studio and if you look at the app definition xml, there is the Version attribute on the Entity element. I think Visual Studio increments that for me when I make changes, you may need to bump that up. –  Tom Feb 13 '12 at 14:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.