How to create a site column from this field as a Feature

Nov 20, 2008 at 8:05 PM
Hi there,
At the outset, THANKS a lot for this amazing control, especially the changes you made in the original Datacogs control. So now I can see that it works across site collection too (due to the elevated permissions). I got it fully working through SharePoint UI ie. goto Doc Lib settings and Create a new column page...
Now the questions is how do we use this field to create a site column through a Feature (i.e. using the XML)?
I know the standard XML for a Text type site column i.e.
<?xml version="1.0" encoding="utf-8" ?>
<
Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<
Field
ID="{63590418-87F5-4fa7-AF50-B371C88F2F56}"
Name="CustomerAccountNumber"
DisplayName="Customer Account Number"
Description="A customer account number used within the company."
Type="Text"
MaxLength="10"
Group="Grounding Site Columns"
>
</
Field>
</
Elements>
But how to use similar technique for this custom field instead of Text?
thanks.
Nov 21, 2008 at 12:59 AM
Never mind,
I think I figured it out (had to use a real dirty trick)
But I have not yet added this field in a Feature and tried it out, will post the success/failure later...LOL

<Field Type="QueryLookUpDropDown"
                           DisplayName="Tech"
                           Required="FALSE"
                           ID="{7adcbc90-206d-4bf9-8c14-5341ac816fd8}"
                           SourceID="{6b8a6b71-039c-4c6d-ab15-4ac1830ad937}"
                           StaticName="Tech"
                           Name="Tech"
                           ColName="nvarchar10"
                           RowOrdinal="0"
                           Version="1">
                        <Customization>
                            <ArrayOfProperty>
                                <Property>
                                    <Name>SiteUrl</Name>
                                    <Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">http://eserve-cms-dev:42501/sites/app_zone</Value>
                                </Property>
                                <Property>
                                    <Name>LookUpListName</Name>
                                    <Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">/sites/App_Zone/Lists/Technologies/AllItems.aspx</Value>
                                </Property>
                                <Property>
                                    <Name>LookUpDisplayColumnText</Name>
                                    <Value xmlns:q3="http://www.w3.org/2001/XMLSchema" p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Technology</Value>
                                </Property>
                                <Property>
                                    <Name>LookUpDisplayColumnValue</Name>
                                    <Value xmlns:q4="http://www.w3.org/2001/XMLSchema" p4:type="q4:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Technology</Value>
                                </Property>
                                <Property>
                                    <Name>ActualQuery</Name>
                                    <Value xmlns:q5="http://www.w3.org/2001/XMLSchema" p4:type="q5:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{0}</Value>
                                </Property>
                                <Property>
                                    <Name>SQLQuery</Name>
                                    <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Where</Value>
                                </Property>
                                <Property>
                                    <Name>BadQueryFlag</Name>
                                    <Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">1</Value>
                                </Property>
                            </ArrayOfProperty>
                        </Customization></Field>

Yeah, that's right...it looks real "ugly"...:)
Nov 21, 2008 at 1:59 AM
Sorry folks,
this field definition doesn't work in the Feature deployment method...:(
It fails while doing the "Feature Validation"...
If anyone else knows a better Field definition, pls feel free to publish...
Coordinator
Dec 11, 2008 at 5:21 PM
to my knowledge,
field definitions are not of those components that could be enabled/disabled through a feature as an element
from what i know, they are crawled thru during the worker process initiation and registered with the server
all you gotta do is dump the "FLDTYPE_<fieldname>", required user controls, and other resources (resx) in required location and reset IIS
you will see your field in next IIS reset


Jan 6, 2009 at 7:24 PM
Thanks Maiden123,
but my issue is not about "deploying this field control", my issue is about creating/deploying a content type which will have a site column based on this control.

Say, I have deployed this field control successfully and I can goto a doc lib, create a new column of this field type and it works great.
Now I want to create a content type which will have a few site columns (say 5 for instance) based on this field type so that when I add this content type to a doc lib, all those 5 columns will get added to that doc lib. For this scenario, we will need to create/deploy a content type as a Feature which will have the XML schema for all these 5 columns in it (the way I have given in my first post).

So bottom line is, I need the XML schema for a site column which is based on this field control instead of any OOTB field control like Text or Date.

thanks,
Pankaj
Coordinator
Mar 20, 2009 at 6:40 PM
Good one,
never looked into this. Actually, this field control must be missing on lot of things as my understanding of field controls back then was only from the 2 day theory and msdn that i had gone through. I will definitely look into all the holes when i get time.
Aug 25, 2009 at 9:47 PM

Hi maiden123 / pankajdarure,

Any news on this one?

These fields seem really handy, but as long as they can't be created using caml (the way described above), they won't be really useful in site provisioning or feature scenarios.

Don't get me wrong.. your work is really appreciated. The functionality of these fields is great, exactly what is missing from the standard MOSS fields.

 

Looking forward to your response.

Greetings,

 

David

Coordinator
Aug 26, 2009 at 7:22 AM
I fear it seems there is no default CAml way of provisiong fields with data in its reference fields. the querybased lookup field for e.g. needs 6 metadata fields to work right, like siteurl, listurl, displaycolumntext, displaycolumnvalue, camlquery,sqlquery. There is no way in MOSS (not that i or many other MVPs  that i've questioned this know of apparantly) to set these metatfields in features <Fields> element.
Believe me, i was the first one to worry about this when i made the field. you can get to MS technet team to see if there is some workaround or not.
though you can use object model in featurereciever. but XML... i am not sure of

2009/8/25 davidslot <notifications@codeplex.com>

From: davidslot

Hi maiden123 / pankajdarure,

Any news on this one?

These fields seem really handy, but as long as they can't be created using caml (the way described above), they won't be really useful in site provisioning or feature scenarios.

Don't get me wrong.. your work is really appreciated. The functionality of these fields is great, exactly what is missing from the standard MOSS fields.

 

Looking forward to your response.

Greetings,

 

David

Read the full discussion online.

To add a post to this discussion, reply to this email (CustomFieldControls@discussions.codeplex.com)

To start a new discussion for this project, email CustomFieldControls@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 28, 2009 at 2:00 PM

Hi Maiden123,

Thanks for your quick response.

Too bad it can't be done in XML, but as you mentioned, there is a way to do it in the featurereceiver and create the field in code.
Even though XML would be a cleaner way, this will do the trick :)

Thanks again for your support!

Kind regards,

David