How to create a site column through Visual Studio 2010?

I was trying to create lists, content type and site columns through Visual Studio 2010. But I could not figure out how to add site column? What item do I need to add for this and what kind of coding is to be done?

Try this
1. Create a Empty project in Visual studio.
2.The Empty SharePoint Project template does not include any Features in the Features folder. To add a new Feature to this project, right -click the Features folder, and click Add Feature. This adds a new Feature component to the folder; double – click the
Feature1 icon in Solution Explorer to modify the Feature ’ s
metadata using the Feature designer. The Title and Description values appear on the Features pages in Site settings. It is a good idea to make these values
descriptive so that administrators will know what they are adding to the site when they activate the feature.
The feature ’ s scope determines where the feature can be activated within SharePoint. Please Note – Certain components, such as site columns, content types, Master pages, and Page Layouts, are installed at the site collection level and made available to all
sites within the collection. These components require that the scope for the feature be set to “ Site. ”
3. Next, add a new item to the project (Right – click project name ➪ Add ➪ New Item) and select the Empty Element template from the Add New Item dialog box.
The Empty Element template is an XML fi le where you can enter CAML Field definitions.
Following is what you will add in your elements.xml file –
< Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
< Field ID="{76C140E1-D827-433B-AD38-257F9594B846}"
Name="CustomCol"
DisplayName="My Custom Site Column"
Group="Custom group"
Type="Text"
Required="FALSE"/ >
< Field ID="{5F516D92-969C-4661-81B9-C9210E2A2FDC}"
Name="Choice Type"
DisplayName="My Choice Type"
Group="Custom group"
Type="Choice"
Required="FALSE" >
< CHOICES >
< CHOICE > Medical < /CHOICE >
< CHOICE > Dental < /CHOICE >
< CHOICE > Vision < /CHOICE >
< CHOICE > Insurance < /CHOICE >
< /CHOICES >
< /Field >
< /Elements >
4. To deploy the Site Columns defined in the Elements file, right – click the project name in the Visual Studio Solution Explorer, and select Deploy. This will deploy the solution file to the solution store and activate the Feature in the targeted site collection.

Similar Messages

  • When should we must create site pages through visual studio?

    Generally site pages are created through SP designer. But what are business requirement when we MUST create site pages through visual studio rather than designer? I
    mean situation should demand we MUST create site pages through visual studio rather than designer. Need some example .

    Hi Sunil,
    when it contains code behind
    http://blogs.msdn.com/b/kaevans/archive/2010/06/28/creating-a-sharepoint-site-page-with-code-behind-using-visual-studio-2010.aspx
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

  • How to add new browser type in visual studio 2010 performance test?

    Hi All,
           Currently we have various list of browsers in browser type drop down,Suppose if i want to add browsers like Internet Explorer 9 (or) 10,Firefox 33 (or) later version.How to add?

    Thanks for Adrian's help.
    Hi Balaji,
    Based on your issue, I agree with Adrian's suggestion. Therefore, I suggest you can try Adrian's suggestion to refer the link of Cybermaxs' reply check your issue.
    In addition, I suggest you can use fiddler to check the header definition.
    For more information, I suggest you can refer the Shiv_P's reply in the following link.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/9bb37eec-3467-4fcb-8537-648d04e91e2f/how-to-add-latest-chrome-browser-plugin-in-visual-studio-2010-ultimate-for-performance-testing?forum=vstest
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create demand management workflow using visual studio

    Hello all,
    I need to create demand management workflow (Project server 2013) using visual studio 2012. I need to understand how we can write code in it. Any references??

    Hi Shanila,
    Here are some of the articles you can use for designing workflows using Visual Studio.
    Getting started Project Server 2013 Workflows :
    http://msdn.microsoft.com/en-us/library/office/ee767694(v=office.15).aspx
    Using workflow for Demand Management:
    http://technet.microsoft.com/en-us/library/dn458861(v=office.15).aspx
    Creating Project Workflows using Visual studio 2012:
    http://blogs.msdn.com/b/project_programmability/archive/2012/11/07/creating-project-workflows-using-visual-studio-2012.aspx
    Thanks,
    Phani

  • Provision a document library definition with managed metadata column using Visual Studio 2010 designer

    hi all,
    how can i create a document library with a managed metadata column and lookup column .
     what  should be the  type for managed metadata column ? is it "Taxonomy", if yes how can i enter the term set values which should be populated by default.
    also would like to know how to refer the parent list / column[field] in the loopkup field
    help is appreciated!
    thnx

    Hi,
    To add a Managed Metadata field into the list definition, you can take a look at the link below with steps in details about the same requirement.
    http://gheckoplus.blogspot.com/2011/10/how-to-sharepoint-2010-list-definition.html
    For the Lookup field:
    http://abdulazizfarooqi.wordpress.com/2012/08/17/provisioning-lookup-field-in-sharepoint-2010-lookup-field-in-the-list-in-sharepoint-2010/
    http://ronsp.wordpress.com/2011/04/27/declaratively-adding-a-lookup-field-to-a-list-schema-using-customschema-attribute-in-listinstance/
    What’s more, if you have several questions to ask, I suggest you post them into every single thread to make them easier to be discussed in the forum.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Create SharePoint 2013 workflow using visual studio 2013

    Dear Team,
    How  to create a workflow for template approval process using visual studio 2013.To achieve this do i need to install share point on my machine.

    Hi,
    According to your post, my understanding is that you want to create a SharePoint 2013 workflow using Visual Studio 2013.
    We need setting up and configuring Microsoft SharePoint Server 2013 and the Workflow Manager Client 1.0 server, see Start:
    Set up and configure SharePoint 2013 Workflow Manager.
    The following materials for your reference:
    Develop SharePoint 2013 workflows using Visual Studio
    http://msdn.microsoft.com/en-us/library/office/jj163199(v=office.15).aspx
    How to: Create SharePoint 2013 Workflows using Visual Studio
    http://msdn.microsoft.com/en-us/library/office/dn584771(v=office.15).aspx
    Developing SharePoint 2013 workflows with Visual Studio demo
    http://www.bing.com/videos/watch/video/developing-sharepoint-2013-workflows-with-visual-studio-demo/10t0er5gh
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Issue with New Release Deploying Crystal Reports for Visual Studio 2010

    Previously I created a deployment project with Visual Studio 2010 using the Beta 2 release of the distributable. This worked fine and installed on a 32-bit XP machine.
    I've since updated the project to use the new Release version of the distributable CRRuntime_32bit_13_0.msi. Now when I run the installed program it gives me the following message -
    "An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information."
    I've had a look at verious posts and added code to the app.config file so it looks like -
    <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    and also tried targetting various .NET frameworks, but without success.
      Am I missing something?

    Hello,
    More info, are you installing on the same PC as the Beta was installed on or a clean PC?
    Your app must be set to the full framework, not the client version.
    Are you installing by right clicking on your setup.exe and selecting run as administrator?
    Setting that option in the app.config is only required if you are using that driver you found the info on.
    Run ProcessMonitor and set it to filter your installer and see what it reports.
    Thank you
    Don

  • Loading rdf report in Visual Studio 2010

    hi,
    I have to migrate our reports to the visual studio 2010 framework. I converted my oracle reports (.rdf) to xml format using rwconverter. Then I tried to run one of them from a WPF application using Process.Start("report.xml"); but it only displays the xml source code. I also tried to use a XMLtoPDF converter which parse a xml file and generate the PDF report; but it doesnt fit with the xml structure generated by rwconverter.
    Does somebody know how to run the xml report under Visual Studio 2010? thank you

    "Unknown". Certainly, at this time the info is not available publicly. It may even be the CR is not part of future builds of .NET (?). On the other hand, going by how these bundles have gone in the past, I'd suspect if there is a CR bundle or an add on of some sort, it will be what ever will be the current version minus 1. Will it be as fully featured as the currently shipping CR 2008? Again, go by past bundles. (E.g.; if there is something like CR 2010 out there, the bundle would probably be some variation of CR 2008). Will it be 64 bit? Again, consider the history; bundles that come with .NET 2005 and .NET 2008.  
    Disclaimer:
    These are my personal speculations and conclusions and are not meant to be interpreted as the "official" word from SAP.
    Ludek

  • How to programmatically create a site column and a content type

    Hello,
    I'd like to create a site column (let's say a field text) and a content type, only  using c#  -i.e. I don't want to add new item/column and then xml. This code will be added to a FeatureActivated.My code is :
    public override void FeatureActivated(SPFeatureReceiverProperties properties) {SPWeb rootweb = (SPWeb) properties.Feature.Parent;
    SPFieldText field = new SPFieldText(SPfiledscollection???, "field1");
    if (field != null)
    rootweb.Fields.Add(field)
    rootweb.Update();
    }   SPContentType newContentType = new SPContentType(spcntenttypeId??, SPContentTypeCollection ??, "content1");
       rootweb.ContentTypes.Add(newContentType);
       rootweb.Update();
    Are there any sample codes out there? I've only found samples using xml - which has an irritating "feature"
    Thank you
    Christos

    Nice code and it helped me understand. Some small questions. I'm trying to make all the "data" for a (sub)web site.
    So, I think, my steps are:
    1. create site columns+content type
    2. create  list
    3. create a lookup site column that uses the list on <2>
    4. create content type that uses the site column on <3>
    5. Create the list for the content type on <4>
    My confusion is: should I use one feature for everything? Your code is using scope=site, so i need to "hardcode" the web site's name. I don't mind doing that , I just don't know how to use scopes in features for creating data.
    Thank you
    Christos

  • How to apply customization through visual studio to the SharePoint online

    We have an existing SharePoint online site, now there are some changes in functionality is required, can we do that change through visual studio and send that change to
    SharePoint online site? will it work?
    or we have to do the same only through the JQuery or other client side code directly to the site?

    Short list of what can't be done:
    deploy any compiled code to a server. This includes DLLs, EXEs and full trust SharePoint Solutions.
    deploy any file to a server disk drive. This includes anything usually stored in the 15 hive, site definitions, etc.
    What can be done:
    Anything that could also be done with SharePoint Designer.
    Anything that is a file that can be loaded into a library. You can create and upload pages, as long as there is no server side code (C# etc.). These pages can include JavaScript, jQuery, CSOM, HTML, CSS, etc.
    Create SharePoint 2013 apps. These can run custom code, but only if on an external to SharePoint servers.
    See here for more:
    http://technet.microsoft.com/en-us/library/sharepoint-online-developer-service-description.aspx (Developer Features in SharePoint Online)
    Overview of SharePoint 2013 development:
    http://msdn.microsoft.com/en-us/library/office/jj164084(v=office.15).aspx
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

  • How to create interactive map in SAP Visual Business using SAP UI5 SDK

    Hi,
    Please tell me,
    How to create interactive map in SAP Visual Business using SAP UI5 SDK.
    Is it possible to create interactive map using VB Control in SAP UI5 SDK..?
    if possible please any one let me know.

    Hi folks, one question:
    We have our development close moved and now it is earlier than originally planned. 
    That means that we maybe can't finish our convenient API and you have to wait till we will release it - early 2015 is planned.
    But there is another option:
    Currently we have a API based on json. The developer has to create json and  to transfer it to the Visual Business control.
    This interface is more used as a low level API and we are developing on top the more convenient one. So all the features are the same.
    It will stay stable & compatible in the future and you can build on it.
    Do you want to use this interface?  
    Then I will publish the documentation.
    Let me know.
    Thanks

  • How to create Activex object for my Visual C++ object

    Hi,
    I am working on development on Acrobat 9.0 SDK. I am facing problem is that I can compiled Visual C++ source code to an api. I can test functions on this api on Acrobat 9.0 windows, but I could not test it on IE web browser, because I don't know how to create Activex object from my Visual C++ source code or its api.
    I read Acrobat 9 SDK document and found under C:\Acrobat 9 SDK\Version 1\PluginSupport\Tools\Visual Studio App Wizard has two files: Acro9PIWizInstaller.msi and setup.exe. I am not very sure those file are the key to help me to create Activex objects for my api.  Are they the one I need to create Activex object? If not, could you please advise me how to create Activex object for my api or C++ codes.
    Thanks a lot for any of your comments or advices.
    Thai

    Hi lrosenth,
    Thanks a lot for your information.
    My question is, on Javascript how do I call a function from .api. Below is my very simple test.
    I got a function on BasicPlugin.cpp under C:\Acrobat 9 SDK\Version 1\PluginSupport\Samples\BasicPlugin. See below.
    I added BasicPlugin.api on C:\Program Files\Adobe\Acrobat 9.0\Acrobat\plug_ins
         ACCB1 int ACCB2 MyPluginCommand() {
              int num = 5;
              return num;
    On my HTML file, I create an <Object> below:
        <OBJECT id="acrobatapp"
                classid="clsid:85DE1C45-2C66-101B-B02E-04021C009402">
        </OBJECT>
        <OBJECT id="acrobatpdf"
                classid="clsid:CA8A9780-280D-11CF-A24D-444553540000"   >
            <Param name="SRC" value="http://www.adobe.com/devnet/acrobat/pdfs/acrobat_digital_signature_appearances_v9.pdf">
       </OBJECT>
    On my Javascript. I call function MyPluginCommand() as below, but it is not working. How do I call function MyPluginCommand() on Javascript?
         var acrobatapp= document.getElementById("acrobatapp");
         var num= acrobatapp.MyPluginCommand();
         alert(num);
    Thanks for your support,
    Thai

  • How to create Implicit Fact column ?and how to use it ?

    Hi all,
    How to create Implicit Fact column ?
    and how to use it ?
    Thanks in advance

    When you create a request with only dimension columns, the Oracle BI engine has to choose a fact table to join the dimensions to each other. If you have multiple fact tables in your BMM layer, the Oracle BI engine will use the most economical fact table, depending on the number of dimensions of the fact table.
    In some cases you do not want to use this fact table, but you want to force the Oracle BI engine to use the fact table you want.
    In that case you should create a fact (or select an existing fact) of the fact table you want to use for the dimension only query. In the presentation catalog of the subject area you should select this fact as the implicit fact. This fact will always be used in the query, but it won't be visible in your report. An example of an implicit fact is the count of the primary key (id) of the fact table.

  • How to create a Sales Order through an EDI configuration.

    Hi
    How to create a Sales Order through an EDI configuration.
    Tell me the step-by-step procedure for this.
    Any power point presentation would be fine.
    Cheers
    Maruthi

    Hi,
    You can go to these links to know little bit about sales order creation through EDI/ALE by means of IDOCS.
    http://www.riyaz.net/blog/index.php/2008/01/19/beginners-guide-to-ale-and-idocs-a-step-by-step-approach/
    Sales Order Idoc Extension.
    http://www.*******************/2007/11/abap-idocs-basic-tools.html
    For any specific information, just do a google search(information like message t ype, IDOC type, Functoin module, etc. You will definitely get the information you are looking for
    Please reward if this helps you

Maybe you are looking for