Lookup column reference content type insteal of list

i need to create look up column in SharePoint 201o using XML, my problem is i need the look up column to reference certain content type on the list instead of referencing the list itself, can we do that ????
Mohamed Abdeen

Hi,
According to your post, my understanding is that you wanted to create a lookup column reference content type instead of list.
Lookup Fields obtain their values from an existing list. Each Lookup Field is being linked to its list using the list's ID. As the ID's are being generated after creating the instances there is no way to provision a Lookup Field linked to a newly created
list during Solution deployment.
However, we can use the Feature Receivers to achieve it.
Feature Receivers are nothing more than custom code you can attach to events triggered by a feature. Provisioning a custom field programmatically works exactly the same as doing it using the GUI: first you need to create a Site Column and then you need
to attach it to the Content Type of your choice.
Waldek Mastykarz had written a good blog about the lookup field reference content type, you can have a look at it.
http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jason Guo
TechNet Community Support

Similar Messages

  • Cannot add hub-managed content type with external list lookup columns to a list -- Error:Id field is not set on the external data field

    This is a variation on the issue mentioned in this
    post
    We are using SP 2010 Content Hub to manage our content types.  On the content hub we've created a couple of exteranl lists, and then created some site columns as lookups against these lists.  We then added the columns to one of our content types
    and set it to publish.
    After the publishing job executed, I tried adding the content type (which now appears on the subscriber sites) to one of the document libraries on one of the subscriber sites.  When I did that it threw the following error:
    Microsoft.SharePoint.WebControls.BusinessDataListConfigurationException: Id field is not set on the external data field    
    at Microsoft.SharePoint.SPBusinessDataField.CreateIdField(SPAddFieldOptions op)     
    at Microsoft.SharePoint.SPBusinessDataField.OnAdded(SPAddFieldOptions op)     
    at Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op, Boolean isMigration, Boolean fResetCTCol)     
    at Microsoft.SharePoint.SPContentType.ProvisionFieldOnList(SPField field, Boolean bRecurAllowed)     
    at Microsoft.SharePoint.SPContentType.ProvisionFieldsOnList()     
    at Microsoft.SharePoint.SPContentType.DeriveContentType(SPContentTypeCollection cts, SPContentType& ctNew)     
    at Microsoft.SharePoint.SPContentTypeCollection.AddContentTypeToList(SPContentType contentType)     
    at Microsoft.SharePoint.SPContentTypeCollection.AddContentType(SPContentType contentType, Boolean updateResourceFileProperty, Boolean checkName, Boolean setNextChildByte)     
    at Microsoft.SharePoint.SPContentTypeCollection.Add(SPContentType contentType)     
    at Microsoft.SharePoint.ApplicationPages.AddContentTypeToListPage.Update(Object o, EventArgs e)     
    at System.Web.UI.WebControls.Button.OnClick(EventArgs e)     
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    b55297ed-717f-466d-8bdc-297b20344d3f
    I checked the external  content type configuration and it did specify an "id column".  Anyone know if what I am attempting to do is possible and if so, what special configurations are required?
    Thanks

    The issue is not External Content type or external list but the look up column.
    It's not possible to publish a look up column via the Content Type Hub.
    If you need to do this then an alternate way is to use a Managed Metadata column instead, otherwise you will have to implement this via a feature.
    Varun Malhotra
    =================
    If my post solves your problem could you mark the post as Answered or Vote As Helpful if my post has been helpful for you.

  • Sync error with Workspace "Data in this list references content type "", which is no longer in the list schema"

    Dear,
    I saved a document library containing folders and files as a template to use it as a template when I created a document library.  It contains a lot of folders and files.
    When I tried the document library to sync with workspace it gives an error "Data in this list references content type "", which is no longer in the list schema"
    I checked with this error and I found out that it has issue with onenote file, but my library does not contain any onenote file. 
    I wonder if there is any issue regarding the number of folders to sync at a time because when I tried to sync with document library similar to the big library but lesser folders and files. 
    Thanks

    This is caused by certain OneNote files.  I've filed a support ticket on this.  See my
    post on possible workarounds.  You might view the entire library in windows explorer or flatten the folder structure in a view to confirm that there are not any OneNote related files.
    Corey Roth blog: www.dotnetmafia.com twitter:
    @coreyroth

  • Editing Content types at the list level

    Hello, I have a range of Content Types that are administered centrally from a Content Type hub, all of the content types have workflows and retention policies set at the content type hub level.
    I have had a request from a user who wishes to add a template to one of these content types that will be specific to only their document library on their team site.
    The question I'm asking is, if I add a template in the settings of the content type at a list level only, i.e. edit list content type to add a template to it - will it then have any effect on the workflows and retention policy that are set on the content
    type and administered centrally from the content type hub?
    Regards
    kegan1

    Hi,
    As per the Microsoft article "Any changes that you make to a content type for a list or library apply only the instance of that content type that has been added to the list or library. The parent site content type from which the content type was created
    is not updated with the changes."
    So, any changes you made at list level will not be updated at the content type hub level.
    Change a content type for a list or library
    Please mark it answered, if your query answered.

  • SharePoint REST service to add an exsiting site content type to a list/library

    Trying to use SharePoint 2013 REST Service to add existing site content types to a list/library. Below MSDN article suggests that the POST method is available but does not say how to use it.
    http://msdn.microsoft.com/en-us/library/office/jj246793%28v=office.15%29.aspx#postsyntax_htm
    POST http://<sitecollection>/<site>/_api/web/lists(listid)/contenttypes/add(parameters)
    How do we create the body for this rest call?

    Hi You need to use the addAvailableContentType method to attach a Existing Content Type to a list/Library.
    Consider the below Sample. Take the Id of the Content Type and pass it.
    the REST API URL is 
     http://<sitecollection>/<site>/_api/web/lists(listid)/contenttypes/addAvailableContentType(contentTypeId)
    var siteUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Employees')/ContentTypes/AddAvailableContentType";
        var call = jQuery.ajax({
            url: siteUrl,
            type: "POST",
            data: JSON.stringify({            
                "contentTypeId": "0x0100E5EC1FE6D284A74A972A1776FFFE2DA0"            
            headers:
                   'accept': 'application/json;odata=verbose',
                    "content-type": "application/json;odata=verbose",
                    "X-RequestDigest": jQuery("#__REQUESTDIGEST").val()
        call.done(function (data, textStatus, jqXHR) {
            var message = jQuery("#message");
            message.text("Added Content Type Successfully");
        call.fail(function (data, errorcode, errormessage) {
            alert("Could not enable content types: " + errormessage);
    Here 0x0100E5EC1FE6D284A74A972A1776FFFE2DA0 is the Content Type Id of my existing Content type "Employees"
    Ensure the AllowContentTypes is set to True for that List/Library
    R.Mani | http://rmanimaran.wordpress.com

  • Create BCS External Content Type or a list based on a WCF Web Service using Visual Studio

    Hi ,
    How to create a BCS External Content Type or a list Based on a WCF Web Service using Visual Studio.
    The link provided here shows the requirement through Designer. http://msdn.microsoft.com/en-us/library/office/ee556431(v=office.14).aspx but I want this to be through VS code..
    Please help ..Appreciate your help..
    Thanks,
    Satheesh

    HI Sateeshlt,
    You can see the below link also;
    http://www.fabiangwilliams.com/2013/10/14/part-2-of-3-blog-update-on-sharepoint-bcs-with-full-crud/
    Best Regards,
    Brij K

  • How to set RelationshipDeleteBehavior on a list using a site column and content type programatically CSOM c#

    On Prem development machine, I'm writng a deployment routine in c# using the client object model.  I've created some site columns of type Lookup, I've created a content type and added those lookup columns to it and I've created a list using the
    content type.  I want to set the RelationshipDeleteBehavior property on some of the lookup columns in the list.  I'm also using the 16 assemblies.
    List list = cc.Web.GetListByTitle("MyList");
    cc.Load(list);
    cc.ExecuteQuery();
    Field f = list.Fields.GetByInternalNameOrTitle("MyLookupField");
    cc.Load(f);
    cc.ExecuteQuery();
    (f
    as
    FieldLookup).RelationshipDeleteBehavior =
    RelationshipDeleteBehaviorType.Restrict;
    f is returning as a Field but (f
    as
    FieldLookup) is returning null here.  Any insight on this?
    Thank you.
    Dan Budimir

    Hi,
    We can use SP.ClientContext.castTo method to convert the field to lookup field . The following code snippet for your reference:
    ClientContext context = new ClientContext("http://siteurl");
    NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
    context.Credentials = credentials;
    Web web = context.Web;
    List list = web.Lists.GetByTitle("MyList");
    Field field = list.Fields.GetByInternalNameOrTitle("MyLookupField");
    FieldLookup lookupField = context.CastTo<FieldLookup>(field);
    lookupField.RelationshipDeleteBehavior = RelationshipDeleteBehaviorType.Restrict;
    lookupField.Indexed = true;
    lookupField.Update();
    context.ExecuteQuery();
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Look up column in Content Type Hub

    Hi,
     Would like to know whether look up columns are  supported /not supported in content type hub.
     Currently I am having few columns in my doc.libs which uses look up column and i want to implement content type hub.
    heard that this is a limitation in CTH.
    Can anyone from MS pls confirm.
     and at the same  time if I want to use the look up column functionality and implement CTH, any alternatives available.
    help is  highly appreciated!

    Hi,
    Please refer to the following article, it might help
    Content Type Hub Sync & Lookup lists
    And also refer to the following post.
    Content Type Hub Syndication and lookup site column within a content type
    Please mark it answered, if your problem resolved.

  • External Content Type not displaying List.

    I am getting the following Error when i go to the External Content Type List i Created.
    Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.
    When i open it up in Sharepoint Designer and look at the page i get this error.
    soap:ServerException of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.An error has occurred.
    I'm connecting to a SQL Server with sql server credentials. I'm able to see the tables and columns in the Data Source Explorer.
    The permissions for the Content Type are all authenticated Users with everything checked.

    Hi,
    How did you supply username and password to the external content type?
    As i know, there are four options (user's identity, BDC's identity, impersonate windows identity, impersonate custom identity), you cannot directly input the SQL username and password.
    I suggest you to use impersonate custom identity.
    Before using it, you need to create a new target application ID in secure store service application. and select
    user name and password for filed type at second step. after that, you need to set credentials for this target application ID to input your sql user name and password there.
    Then you need to input this target application ID at connection properties (both default and client tabs) of the external content type.
    Regards,
    Seven

  • Add Already Existing Taxonomy Column to Content Type using visual Studio

    Hi
    I need to add existing Taxonomy Site Column to my Content type, which will be used in  my SharePoint list Everywhere I have seen it is talking about how to create managed metadata column and then add it to your site content type.My column is already
    present just I need to use it. How can I do this?
    <ContentType
    ID="0x0100b58d33764b384da58bbadee9721e1843"
    Name="MyCustomContentType"
    Group="Custom"
    Description="Custom provisioned contenttype containing a Taxonomyfield"
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="8D0458C1-0FB7-4981-BEE1-52D0DF01895C" Name="MyTaxonomyField"/>
    <FieldRef ID="3a913424-fc7f-49ef-8fb6-a2ca1712cdc3" Name="MyTaxonomyFieldTaxHTField0"/>
    <FieldRef ID="f3b0adf9-c1a2-4b02-920d-943fba4b3611" Name="TaxCatchAll"/>
    <FieldRef ID="8f6b6dd8-9357-4019-8172-966fcd502ed2" Name="TaxCatchAllLabel"/>
    </FieldRefs>
    </ContentType>
    Where I can get ID of existing Site Columns as well as TaxCatchAll and TaxCatchAlllabel

    Hi,
    To get the ID of existing site columns, you can use SharePoint Manager 2010:
    Take a look at the post:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/f95fb1e9-d9a9-48e8-b99e-4262bffa8968/sharepoint-manager-2010-how-to-update-list-schema-xml
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to customise and navigate Content Type - SharePoint 2013 List

    I need some advice here. I'm customizing forms that have list built using Content Types. I noticed the difference in the links is something like this below I have one default content list type called item and the other one is called College Form
    Item is ContentTypeId=0x01003FF12EB7EAB88340BEE53D34C38A906200147E508F34B9164ABE555FF698569C27
    College Form is ContentTypeId=0x01003FF12EB7EAB88340BEE53D34C38A906200147E508F34B9164ABE555FF698569C27
    When doing my customization of the form I would like to hide some fields and show some based on the content type. I know by default the content type does that. But im using JS to hide some fields but don't know how i can do this or what values to use to
    make this happen.
    Any ideas and thanks in advance

    WPQ2FormCtx.ItemContentTypeId will give the content type ID of the item in each of the forms newform.aspx, ediform.aspx and displayform.aspx. You can also use WPQ2FormCtx.ItemContentTypeName, if you want to compare name instead of Id. Here is a JQuery
    code to hide fields in the forms:
    <script type="text/javascript">
    jQuery(document).ready(function($) {
        if(WPQ2FormCtx.ItemContentTypeId == '0x010400C36D463A4788AD4AAF5F85C02DA29F8E') {
        $("h3.ms-standardheader:contains('Body')").closest("tr").hide();
    </script>
    Note that this script assumes the JQuery is already referenced in the site. You can place above code in Script Editor web part in each of the forms. 
    Also, beware that this way you can hide the field from UI, but user can still open the page source and find the actual information in the hidden field. 
    If the requirement is to completely hide the field data then you will need to set the field properties like showInEditForm, showInDisplayForm and showInNewForm
    Nadeem Yousuf

  • How to add [Thunderbird] Attachments content type action to list

    Thunderbird, Linux. Attachments. There is only one entry: Microsoft word documents. I want to add
    other attachment types, like .jpg (open with Gwenview) and so on, but I don't know how to add anything
    to the list.
    When I snapped on the "Post Question" box below this, it added a "troubleshooter" which was no help whatsoever.
    Please just tell me in English how to do this.
    Thanx.

    WPQ2FormCtx.ItemContentTypeId will give the content type ID of the item in each of the forms newform.aspx, ediform.aspx and displayform.aspx. You can also use WPQ2FormCtx.ItemContentTypeName, if you want to compare name instead of Id. Here is a JQuery
    code to hide fields in the forms:
    <script type="text/javascript">
    jQuery(document).ready(function($) {
        if(WPQ2FormCtx.ItemContentTypeId == '0x010400C36D463A4788AD4AAF5F85C02DA29F8E') {
        $("h3.ms-standardheader:contains('Body')").closest("tr").hide();
    </script>
    Note that this script assumes the JQuery is already referenced in the site. You can place above code in Script Editor web part in each of the forms. 
    Also, beware that this way you can hide the field from UI, but user can still open the page source and find the actual information in the hidden field. 
    If the requirement is to completely hide the field data then you will need to set the field properties like showInEditForm, showInDisplayForm and showInNewForm
    Nadeem Yousuf

  • Is there a way to know if my Content Type's fields are a Site columns or List columns

    I am totally confused about Site columns, list columns and content types. as seems i will have the same column name , sometimes dealt with as site column while the other as list column. for example i created a new Issue tracking list which comes with the
    following columns:-
    now i realize that the Description column is a list column (not site column) because if i rename the site column named Description, this list column will not get affected, while column such as "Issue status" is a site column because if i rename
    the site column named "Issue Status" the column inside the "Issue" content type will get affected. while there are two site columns named Description but none of them are used insidie the "Issue" content type, and the Description
    field in the above picture is a list column !!
    so can anyone advice from where i can differentiate if a column inside the Issue content type is a site column or is a list column ???
    Thanks

    Hi John,
    Thanks for posting your issue, Kindly browse the below mentioned URL to identify the site columns and Content Type in your Top level site
    http://www.kalliance.com/blog/tips-tutorials/microsoft/identifying-site-columns-content-types/
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • List content type columns don't show new names after resource files were changed

    Hello,
    we ran into a problem, that we're not able to figure out at the moment.
    We have a site collection with site columns and site content types defined and created with
    features ant their XML files. All display names are retrieved from resource files. We do have
    several subsites, that have predefined lists also created from features and their corresponding
    XML files. They use inherited versions of these site content types as list content types with
    their columns inherited from the site columns.
    We had some changes within the resource files and never ran into a problem up to now.
    We changed the display names of some of these columns within the resource files. After
    these changes the site columns, site content types and list columns show the changes
    as planned. Unfortunately the columns of the list content types do not display the changes.
    They still show the old name. If you try to alter the old names manually the new name is
    shown within the form, but you're not able to save it and the list content type columns
    still have their old name afterwards.
    We checked our definition files and they seemed to be well.
    Any ideas?
    Regards,
    Markus
    List columns as defined within new the resource file:
    List content type columns, that do not show the changes from the new resource file:

    Hi,
    According to your post, my understanding is that you want to modify the site column name in the list.
    I try to reproduce the issue, however, everything works well.
    You can modify the DisplayName in the Element.xml file.
    Then after you redeploy the project, the site column name will be changed in the list setting page.
    In addition, please check whether you create the list correctly.
    For more information, you can refer to
    Walkthrough: Create a Site Column, Content Type, and List for SharePoint
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Content type, list definition and List instance - query

    Dear all,
    I created a list content type, list definition and list instance for a SessionsList.
    I did mistake when created a event receiver file where field name is RegistrationsInfo - did typo error as RegistrationInfo. This field I want to make it as false in the ShowInNewForm= false
    When I deploy it with event receiver file - I am getting stack trace error stating that the RegistrationsInfo field is missing.
    Without event receiver file - when I deploy the solution and checked the field name - it is showing rightly as RegistrationsInfo.
    Content Type:-
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Field ID="{7113CBE5-57E9-4082-A0A2-492B35B69C8D}" Type="Lookup" List="Lists/Courses-List" ShowField="Title" Name="CourseTitle" DisplayName="Courses - Title" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{920AE6A7-2AAE-4E43-8855-7CBD9978EC5E}" Type="Lookup" List="Lists/SessionTrainer" ShowField="FullName" Name="Trainer" DisplayName="Trainer" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{F73D9A96-3C86-4E33-96D5-31E30B08BF40}" Type="Choice" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE" Group="Training Site Columns">
    <CHOICES>
    <CHOICE>Kerala Meeting Room</CHOICE>
    <CHOICE>Orissa Meeting Room</CHOICE>
    <CHOICE>Bihar Meeting Room</CHOICE>
    </CHOICES>
    </Field>
    <Field ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" Type="Number" Decimals="0" Min="0" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{03281B47-F1D1-477E-9793-3A19118720EE}" Type="Number" Decimals="0" Min="0" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{8A900663-6351-445B-ACB3-394F44D45C8D}" Type="Calculated" ResultType="Number" ReadOnly="TRUE" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE" Group="Training Site Columns">
    <Formula>=TotalSeatsInfo-RegistrationsInfo</Formula>
    <FieldRefs>
    <FieldRef Name="TotalSeatsInfo" ID="{03281B47-F1D1-477E-9793-3A19118720EE}"/>
    <FieldRef Name="RegistrationsInfo" ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}"/>
    </FieldRefs>
    </Field>
    <!-- Parent ContentType: Item (0x01) -->
    <ContentType ID="0x0100a9dc01b7e78b45799fe59153d97e2b9e"
    Name="SessionList"
    Group="Session Content Types"
    Description="Session Content Type"
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{7113CBE5-57E9-4082-A0A2-492B35B69C8D}" Name="CourseTitle" DisplayName="Courses - Title" Required="TRUE"/>
    <FieldRef ID="{920AE6A7-2AAE-4E43-8855-7CBD9978EC5E}" Name="Trainer" DisplayName="Trainer" Required="FALSE" />
    <FieldRef ID="{F73D9A96-3C86-4E33-96D5-31E30B08BF40}" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE"/>
    <FieldRef ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE"/>
    <FieldRef ID="{03281B47-F1D1-477E-9793-3A19118720EE}" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE"/>
    <FieldRef ID="{8A900663-6351-445B-ACB3-394F44D45C8D}" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE"/>
    </FieldRefs>
    </ContentType>
    </Elements>
    Schema:-
    <?xml version="1.0" encoding="utf-8"?>
    <List xmlns:ows="Microsoft SharePoint" Title="SessionList" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/SessionList-LD-SessionList" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
    <MetaData>
    <ContentTypes>
    <ContentType ID="0x0100a9dc01b7e78b45799fe59153d97e2b9e" Name="SessionList" Group="Session Content Types" Description="Session Content Type" Inherits="TRUE" Version="0">
    <FieldRefs>
    <FieldRef ID="{7113CBE5-57E9-4082-A0A2-492B35B69C8D}" Name="CourseTitle" DisplayName="Courses - Title" Required="TRUE" />
    <FieldRef ID="{920AE6A7-2AAE-4E43-8855-7CBD9978EC5E}" Name="Trainer" DisplayName="Trainer" Required="FALSE" />
    <FieldRef ID="{F73D9A96-3C86-4E33-96D5-31E30B08BF40}" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE" />
    <FieldRef ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE" />
    <FieldRef ID="{03281B47-F1D1-477E-9793-3A19118720EE}" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE" />
    <FieldRef ID="{8A900663-6351-445B-ACB3-394F44D45C8D}" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE" />
    </FieldRefs>
    </ContentType>
    </ContentTypes>
    <Fields>
    <Field ID="{7113cbe5-57e9-4082-a0a2-492b35b69c8d}" Type="Lookup" List="Lists/Courses-List" ShowField="Title" Name="CourseTitle" DisplayName="Courses - Title" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{920ae6a7-2aae-4e43-8855-7cbd9978ec5e}" Type="Lookup" List="Lists/SessionTrainer" ShowField="FullName" Name="Trainer" DisplayName="Trainer" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{f73d9a96-3c86-4e33-96d5-31e30b08bf40}" Type="Choice" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE" Group="Training Site Columns">
    <CHOICES>
    <CHOICE>Kerala Meeting Room</CHOICE>
    <CHOICE>Orissa Meeting Room</CHOICE>
    <CHOICE>Bihar Meeting Room</CHOICE>
    </CHOICES>
    </Field>
    <Field ID="{b6e9c8f5-f1bd-4d98-bd30-194504859acc}" Type="Number" Decimals="0" Min="0" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{03281b47-f1d1-477e-9793-3a19118720ee}" Type="Number" Decimals="0" Min="0" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{8a900663-6351-445b-acb3-394f44d45c8d}" Type="Calculated" ResultType="Number" ReadOnly="TRUE" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE" Group="Training Site Columns">
    <Formula>=TotalSeatsInfo-RegistrationsInfo</Formula>
    <FieldRefs>
    <FieldRef Name="TotalSeatsInfo" ID="{03281B47-F1D1-477E-9793-3A19118720EE}" />
    <FieldRef Name="RegistrationsInfo" ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" />
    </FieldRefs>
    </Field>
    </Fields>
    <Views>
    <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
    <FieldRef Name="LinkTitleNoMenu">
    </FieldRef>
    <FieldRef Name="CourseTitle"></FieldRef>
    <FieldRef Name="Trainer"></FieldRef>
    <FieldRef Name="TrainingVenue"></FieldRef>
    <FieldRef Name="RegistrationsInfo"></FieldRef>
    <FieldRef Name="TotalSeatsInfo"></FieldRef>
    <FieldRef Name="OpenSeatsInfo"></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\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
    <FieldRef Name="Attachments">
    </FieldRef>
    <FieldRef Name="LinkTitle">
    </FieldRef>
    <FieldRef Name="CourseTitle"></FieldRef>
    <FieldRef Name="Trainer"></FieldRef>
    <FieldRef Name="TrainingVenue"></FieldRef>
    <FieldRef Name="RegistrationsInfo"></FieldRef>
    <FieldRef Name="TotalSeatsInfo"></FieldRef>
    <FieldRef Name="OpenSeatsInfo"></FieldRef>
    </ViewFields>
    <Query>
    <OrderBy>
    <FieldRef Name="ID">
    </FieldRef>
    </OrderBy>
    </Query>
    <ParameterBindings>
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
    </View>
    </Views>
    <Forms>
    <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    </Forms>
    </MetaData>
    </List>
    Event Receiver file:-
    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    //Reference the newly created session list and perform the following
    //1. Set the display name of the "Title" column to "SessID" and hide it from the New and Edit Forms
    //2. Make the "SessID" column not required
    //3. Set the default value of the RegistrationsInfo column to 0 and do not display it on the new form
    //4. Add the built-in "Start Date" and "End Date" columns
    //Reference the newly created session list
    SPWeb currentWeb = properties.Feature.Parent as SPWeb;
    //currentWeb.AllowUnsafeUpdates = true;
    SPList sessionList = currentWeb.Lists["SessionList"];
    //Title column update
    SPField titleField = sessionList.Fields["Title"];
    titleField.Required = false;
    titleField.ShowInNewForm = false;
    titleField.ShowInEditForm = false;
    titleField.Title = "SessID";
    titleField.Update();
    //RegistrationsInfo column updates
    SPField registrationField = sessionList.Fields["RegistrationsInfo"];
    registrationField.DefaultValue = "0";
    registrationField.ShowInNewForm = false;
    registrationField.Update();
    //Add the Start Date and End Date columns to the list, ensure they both display Date and Time, and add them to the default view of the list
    SPFieldDateTime startDate = currentWeb.Fields["Starting_Date"] as SPFieldDateTime;
    startDate.DisplayFormat = SPDateTimeFieldFormatType.DateTime;
    SPFieldDateTime endDate = currentWeb.Fields["Ending_Date"] as SPFieldDateTime;
    endDate.DisplayFormat = SPDateTimeFieldFormatType.DateTime;
    sessionList.Fields.Add(startDate);
    sessionList.Fields.Add(endDate);
    SPView defaultView = sessionList.DefaultView;
    defaultView.ViewFields.Add(startDate);
    defaultView.ViewFields.Add(endDate);
    defaultView.Update();
    sessionList.Update();
    //currentWeb.AllowUnsafeUpdates = false;
    Can somebody help me - how to overcome the RegistrationsInfo missing field - error(in the stack trace) when activating the feature in the training site?
    Thanks
    Sathya

    Hi Sathya,
    Seems the field “RegistrationsInfo” is not been found when deploying with Event Receiver, a possible reason is that it might be damaged.
    As a workaround, I suggest you retract the solution from your farm, make sure the “RegistrationsInfo” field is deleted using PowerShell, then create another project with the same
    content and perform the deployment again.
    About how to delete a field using PowerShell for your reference:
    https://peterheibrink.wordpress.com/2011/12/09/powershell-delete-field-and-all-references/
    http://www.sharepointfix.com/2011/04/powershell-script-to-delete-site.html
    Feel free to reply if there any progress.
    Thanks
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • This application has failed to start because smerrlog.dll was not found.

    I wrote some code call crystalreport with VB. Net. Sometime, we encounter the error "This application has failed to start because smerrlog.dll was not found". Is there anyone know this? I can't find the smerrlog.dll file in my system, but the report

  • How to compile programs from this sites tutorial?

    Hi, so i'm reading the "GUI" tutorial on this website, it's great but when I compile the example "source codes" it gives me this error: Error: File is in the wrong directory or is declared part of the wrong package. Directory name 'Anna - java' does

  • Mapping File to Multiple IDoc Scenario

    I know how to do this, but when I load the IDoc's XML structure back into the IR, the EDI_DC40 field doesn't have anything in it's structure.  I need to configure the sender parameters in this structure for this IDoc, so any help would be appreciated

  • Problem in data coming to PI system from SAP?

    Hello All, I facing problem with the data coming from SAP system to PI system. in VT02n give the shipment number and after that create some thing and trigger an IDOC. when the data come to PI system, i checked in moni i saw that  data getting mixed.

  • Custom tab in MM01

    Hi All, I have created a custom tab in MM01transaction successfully using SPRO customisation settings. However, when I transport the "Screen sequence" using SCC1 tcode to my "Test client", the order of the of the custom tab is getting randomly change