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]

Similar Messages

  • Application Error while activating the feature - for creating list content type, list definition and list instance

    Dear all,
    I am getting application error while enabling the feature. if any body can point out the issue - that will be helpful.
    content type
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Field ID="{4C1B0A21-FCE0-4CFE-8742-A250672AFE4F}" Type="Note" Name="CourseDesc" DisplayName="Course Description" Required="TRUE" Group="Training Site Columns"/>
    <!-- Parent ContentType: Item (0x01) -->
    <ContentType ID="0x0100d57ecc53fde34177b096abd0ec90a8f9"
    Name="TrainingCourses"
    Group="Training Content Types"
    Description="Defines a Course"
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{4C1B0A21-FCE0-4CFE-8742-A250672AFE4F}" Name="CourseDesc" DisplayName="Course Description" Required="TRUE"/>
    </FieldRefs>
    </ContentType>
    </Elements>
    List definition
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. -->
    <ListTemplate
    Name="TrainingCourses"
    Type="10100"
    BaseType="0"
    OnQuickLaunch="TRUE"
    SecurityBits="11"
    Sequence="410"
    DisplayName="TrainingCourses"
    Description="Training Courses List Definition"
    Image="/_layouts/images/itgen.png"/>
    </Elements>
    List instance
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <ListInstance Title="TrainingCourses"
    OnQuickLaunch="TRUE"
    TemplateType="10100"
    Url="Lists/TrainingCourses"
    Description="Training Course List Instance">
    </ListInstance>
    </Elements>
    schema
    <?xml version="1.0" encoding="utf-8"?>
    <List xmlns:ows="Microsoft SharePoint" Title="TrainingCourses" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/TrainingCourses-LD_TrainingCourses" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
    <MetaData>
    <ContentTypes>
    <ContentType ID="0x0100d57ecc53fde34177b096abd0ec90a8f9" Name="TrainingCourses" Group="Training Content Types" Description="Defines a Course" Inherits="TRUE" Version="0">
    <FieldRefs>
    <FieldRef ID="{4C1B0A21-FCE0-4CFE-8742-A250672AFE4F}" Name="CourseDesc" DisplayName="Course Description" Required="TRUE" />
    </FieldRefs>
    </ContentType>
    </ContentTypes>
    <Fields>
    <Field ID="{4c1b0a21-fce0-4cfe-8742-a250672afe4f}" Type="Note" Name="CourseDesc" DisplayName="Course Description" Required="TRUE" Group="Training Site Columns" />
    </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="CourseDesc">
    </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="CourseDesc">
    </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>
    I am applying the feature to SPWeb level.
    cheers
    Sathya

    redeployed a new solution; since I was getting this error. I would have done typo errors etc.
    https://naveengopisetty.wordpress.com/2011/09/10/error-occurred-in-deployment-step-activate-features-invalid-file-name-the-file-name-you-specified-could-not-be-used-it-may-be-the-name-of-an-existing-file-or-directory-or-you-may-not-have-pe/
    Cheers
    Sathya

  • Creating a external content type for Read and Update data from two tables in sqlserver using sharepoint designer

    Hi
    how to create a external content type for  Read and Update data from two tables in  sqlserver using sharepoint designer 2010
    i created a bcs service using centraladministration site
    i have two tables in sqlserver
    1)Employee
    -empno
    -firstname
    -lastname
    2)EmpDepartment
    -empno
    -deptno
    -location
    i want to just create a list to display employee details from two tables
    empid firstname deptno location
    and same time update  in two tables
    adil

    When I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list.  When I attempt to edit it, I get an error:
    External List fails when attached to a SQL view        
    Sorry, something went wrong
    Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
    I can edit the view in SQL Manager, so it seems strange that it fails.
    Any advice would be greatly GREATLY appreciated. 
    Thanks,
    Randy

  • [svn:fx-trunk] 12554: In anticipation of deferring SDK-24211, I am making List.findKey and List.findString methods mx_internal.

    Revision: 12554
    Revision: 12554
    Author:   [email protected]
    Date:     2009-12-04 14:44:10 -0800 (Fri, 04 Dec 2009)
    Log Message:
    In anticipation of deferring SDK-24211, I am making List.findKey and List.findString methods mx_internal. When we fix SDK-24211, we will probably collapse/remove those two methods
    QE notes: This shouldn't affect tests unless you subclass these methods in which case you'll need to change the function signature.
    Doc notes: No
    Bugs: No
    Reviewer: Evtim 
    Tests run: Checkintests
    Is noteworthy for integration: Yes
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24211
        http://bugs.adobe.com/jira/browse/SDK-24211
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ComboBox.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/DropDownList Base.as

  • Hide a field inherited by the content type in a custom list definition

    The requirement is to create new content type that inherits from a Parent content type. I also created custom document library definition that uses the newly created content type.
    There are some fields that are inherited from the parent type that I would like "NOT TO" show in the edit/display form in the libraries created based on the new list definition.
    How can I achieve this? In the list definition, I added ShowInEditForm="FALSE" and ShowInDisplayForm="FALSE" ShowInViewForm="FALSE".
    But these fields won't hide and it still shows up when a new document is uploaded. Any help would be appreciated.
    Thanks!

    Hey,
    Have
    this link for your reference. It will help you.
    Thanks. Please mark it as an answer if it helps.

  • Customising a SharePoint list content type form - "Manage multiple list items with this form"

    I have designed a form for a content type on an existing SharePoint list.  When I ran the initial wizard, I selected
    Manage multiple list items with this form which is great, exactly what I want.
    But, there are some columns in this content type that I do not want repeating and have them moved them outside of the Repeating Section but I am getting the below error.  I can't seem to find a way to create a new non-repeating group though.  Any
    advice on how to do this?

    *Bump*

  • Add content type to Team Discussion List

    Hi
    I was create a content type with some culoms. then I was add content type on the Team Discussion List and was set as a default item.
    i was add item and filled it and saved
    but there aren't any view! perhaps there don't save!! Where  this item are saved?  

    Hello,
    How did you create that content type? By default all the post gets saved in message content type and display in subject view. Have you tried to open each view ? if not then do so.
    I have also found one similar thread for you info:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/7b074ba1-aed0-49af-8685-0e206001f5d0/custom-discussion-content-type-in-sharepoint-2010?forum=sharepointgeneralprevious
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Difference between list.clear() and new instance

    In the below code,
    List<String> test = new ArrayList<String)();
    list.add("one");
    list.add("two");
    list.add("three");
    list.clear();
    (or)
    list = new ArrayList<String)();
    list.add("four");
    list.add("five");
    What is the difference between List.clear() and creating new instance for list?

    1. Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    2. Invoking clear() sets all the elements of the ArrayList to null and resets the size to 0.    public void clear() {
         modCount++;
         // Let gc do its work
         for (int i = 0; i < size; i++)
             elementData[i] = null;
         size = 0;
        }(modCount is used to detect concurrent modification and throw an Exception when needed)
    Constructing a new ArrayList creates a new, different, empty ArrayList.
    In many situations they might be equivalent, but not in a case where you have two or more variable references to the same ArrayList. Example (watch out for typos)ArrayList<String> stringsA = new ArrayList<String>();
    ArrayList<String> stringsB = stringsA;
    : // add elements to stringsA
    : // stringsB refers to the same populated list
    stringsA.clear(); // stringsB refers to the clear()ed list
    : // add elements to stringsA again
    stringsA = new ArrayList<String>(); // stringsB still refers to the populated listdb

  • Content-type: application/xml and Application server 9

    I have a web service running on Application server 9, implemented using netbeans and JAX-WS.
    When a client sends a request to it with:
    Content-type: application/xml
    the request is rejected because the server does not recognise the mime type.
    Specifically, the response is:
    HTTP/1.1 415 Unsupported Media Type
    X-Powered-By: Servlet/2.5
    Content-Type: text/plain; charset=iso-8859-1
    Date: Fri, 01 Sep 2006 14:49:04 GMT
    Server: Sun Java System Application Server Platform Edition 9.0
    Connection: close
    Everything works fine when the request has:
    Content-type: text/xml
    Is there a way to make my web service accept content type of 'application/xml'?
    -Tony Beaumont
    Aston University
    beaumoaj

    I have fixed this for myself, i.e. decompile, replace in jar.
    My problem was that most tools define the encoding but code was simply testing
    if( contentType.equalsIgnoreCase( "text/xml" ) )
    so sending xml from other tools that send contentType
    "text/xml;encoding=UTF-8" or some such, like soap tools, would mean no XML was seen.
    Is the proper source available for XSQL?

  • Script to Compare File Contents in Two Folders and List Differences?

    I've looked through the Forum but can't find anything that seems quite to address my problem--and I'm really new to AppleScript, so please forgive me if this is a dumb question.
    I burn a great many files of varying kinds (InDesign, Illustrator, Photoshop, PDF, etc.) to DVD everyday as part of my job. It happens not infrequently, though, that files drop out in the process and don't make it to the disk, with the result that I get calls from Manufacturing saying that I've screwed up and that random files X, Y, and Z are not on the disk that I sent.
    I've tried various ways to failproof my burning routine, but utlimately, it seems like something still slips through sometimes--that is, the files are definitely in by Source Folder, but sometimes they don't leap the chasm to the disk. And since there can be several hundred files, it can be difficult to know at a glance if something is wrong.
    It would be extremely helpful if there were a script that I could run to compare the contents of the folder source on my desktop (just say its called "Source Folder") with the contents of a disk I have just burned (whose name might vary, but whose folder structure is a duplicate of the subfolders in "Source Folder" that I have burned to disk. All I need the script to tell me is if there are files in my desktop Source Folder than are not on the burned disk).
    Is this possible? I'd appreciate any help anyone could offer--right now, I'm printing up the disk directory and a list of the files from my desktop Source Folder and comparing them line for line, and my soul is dying.
    Please help!

    This can be pretty easily hacked together using a combination of AppleScript and shell scripting.
    There's a shell command diff that can tell if two directories are the same or not. You can use AppleScript to put a nice front-end on it, like:
    set src to (choose folder with prompt "Select the source directory")
    set dst to (choose folder with prompt "Select the destination directory/disk")
    try
      do shell script "diff -rq " & quoted form of POSIX path of src & space & quoted form of POSIX path of dst
    on error theErr
      display dialog "The following differences were found:" & return & return & theErr
      return
    end try
    display dialog "Directories match. No differences found"
    It's quick and dirty, but should get you started. It runs the diff command which triggers the 'on error' code if there are any differences. The script then reports the differences and exits. If there are no differences the 'on error' code is skipped and you get the all clear message.

  • Listing objects and their instance names (of closed source SWF)

    I have an API for a flash player that I want to use, but it is closed source. I know I could try a decompiler but I need to see what it loads and what it's doing at runtime.
    I'd like to see the objects (and all their info) that it loads and has on stage along with thier instance names. I'd like to see what this SWF has/does so I can write my AS3 code accordingly... maybe add some additional event listeners.
    Is there any was to go about doing this? I know there's some AS3 commands to get this information but I dont know what they are. If you all could give me some hints at which commands would be useful that would be great.

    "I need to see what it loads"
    You can use Fiddles, Charles or Firebug to monitor traffic (what it loads).
    As for the rest of your question - good luck. Although it is possible to decompile swf of course, reverse engineering is an extremely complex time consuming task. In the majority of cases it is easier and faster to replicate functionality from scratch than to try to understand SWF's logic.
    Unless you know packages structure - there is no native way to figure out/access application domain.

  • Creating Calendar List using List definition

    HI,
    How to create a Calendar List based on "List" option in VS 2012 ?
    I have tried the below:
    1) Created custom content type with Events as parent. Added few additional columns
    2) Added a List option, based on default list. Removed the "Item" content type and added the custom content type.
    3) In the List definition and List Instance elements.xml, modified the Type to 106.
    Deployed the solution. The list was created, but it is not a calendar list. What am I missing?
    How to create a Calendar list?
    Thanks

    Hi,
    I had tested with a publishing site using the VS 2012, in the list option, it also contains the calendar based list.
    I didn’t do any other steps, just create an SharePoint 2013-Empty Project, then add new item, select the List option.
    Did you install the Microsoft Office Developer Tools for Visual Studio 2012?
    There are two articles about Prerequisites for creating SharePoint 2013 projects using Visual Studio 2012, you can have a look at them.
    http://blogs.msdn.com/b/timquin/archive/2013/01/22/setting-up-visual-studio-2012-for-sharepoint-2013-development-offline.aspx
    http://blogs.msdn.com/b/how24/archive/2013/03/12/creating-sharepoint-2013-projects-using-visual-studio-2012.aspx
    Thanks,
    Jason
    Jason Guo
    TechNet Community Support

  • Can I add Custom Content Type created programmatically to Custom List Definition?

    I have created Custom content type programmatically in the Feature Receiver. Followed by this have another feature which creates List Template. I want to add the custom content type to the list template.
    Using VS 2012, I added the custom content type to the list definition. The Schema.xml for the list definition looks as below:
    <ContentTypes>
    <ContentTypeRef ID="0x010100D7D9F4B1F4A9684BB44389571024B2EC00C393BB21B8AD7B41B62A87DF0501504D" />
    </ContentTypes>
    ID was automatically added by the VS tool.
    List Template is created, the new content Type is also added, but the Name is displayed as "Document" instead of the custom content type name. So I see two CTs with the name "Document".
    How can I achieve this? Any help is appreciated.

    Hi,
    Please add EnableContentTypes="TRUE" in the <List > tag.
    The following materials would be helpful:
    How to add custom content type to a custom list
    http://innersharepoint.blogspot.de/2009/10/how-to-add-custom-content-type-to.html
    SharePoint Custom List Definition with Content Type
    https://achrafsp.wordpress.com/2013/03/31/sharepoint-list-definition-with-content-type/
    Create a Custom SharePoint List Definition
    http://www.mssharepointtips.com/tip.asp?id=1188
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Deployed lists in a SharePoint hosted app use the wrong content type.

    I am using Visual Studio Ultimate 2013 to deploy a SharePoint hosted app to my SharePoint 2013 development environment. 
    I have created 2 lists, one of which is using a custom content type with custom columns and the other is just a simple custom list definition and instance, all of which are deployed inside the same feature.
    However when I go to the simple list, it is using the content type from the other list, even though in the schema.xml shows that it is not supposed to use this content type. I have checked the content type ID and it is not referencing my custom content type,
    but for some reason the list is using that content type.
    I remember seeing this same issue a few months ago while creating a SP2010 sandbox solution. It could well be something I'm doing wrong when creating the lists/content type.
    Steps to recreate this issue:
    Create a SharePoint hosted app in VS
    Create some custom fields
    Create a custom content type
    Create a list based on that content type
    Create another list not based on the content type
    Delete feature that VS creates for the second list and add the list def and instance to the main feature (containing the other list and content type)
    Deploy and go to second list, note that it has the custom fields from the first list.
    Any advice on what to do about this would be great. I have tried deleting the list and recreating it in VS several times but that didn't work.
    Thanks
    David

    Hi
    I have now tested against a trail Office  365 Developer site and I had to make a few adjustments
    - change the url
    - change the target to SharePoint Onlne
    - change the url 
    I still wasn't happy so I created a new SharePoint Hosted app and pointed at the above developer site.  I copied my CrossDomainExec.js and stripped all my code except my CopyItemInSameLIbrary method which hasn't changed since I created this post. 
    - changed the App Manifest permissions to Web -full Control ( was previously tenant)
    I still got errors which is really painful as you don't even see the POST request in Fiddler
    The URL used for my POST is as follows ( note host URL is fictitious)
    "https://myapphell-547d8061d39e38.sharepoint.com/sites/appsdev/RESTTestSHA/_api/SP.AppContextSite(@target)/web/Getfilebyserverrelativeurl('/sites/appsdev/Shared Documents/SrcDoc.docx')/copyTo(strNewUrl='/sites/appsdev/Shared Documents/DestDoc.docx', bOverWrite=true)?@target='https://myapphell.sharepoint.com/sites/appsdev'" String
    Ran the app a second time and now I see......Wow it WORKS!!!!!! ..Can't be true can it?
    .... next I will switch the target url to my on prem farm to see if this still works so watch this space!
    Daniel
    Freelance consultant

  • 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.

Maybe you are looking for

  • How do you close safari web pages on iPad air

    Hi  Can any body tell me how to close the safari web pages on ipad air.  I have a 5S and it has your pages collected in the right had corner you can click on this and then delete each page, but the Air does not have this.  Can anybody tell me please.

  • Pop to a particular view in Flex Mobile

    I have a viewnavigator application where few views are added(to the stack). I need to pop to a particular view from one view. Flex provided only popView, popAll and popToFirst options. How can I pop to a particular view in the view stack?

  • E-Mail Conflict - Unable to Send Away from Home

    I purchased a new Q10 (Model #SQN100-1) International Version phone in February 2015.  The software version I am working on is 10.3.2.440 which was downloaded when received from BB.  The e-mail service provider is Cogeco and the wireless service prov

  • Error while saving for Objective setting using tcode phap_catalog_pa.

    while executing tcode phap_catalog_pa, i get the error "Table HRPAD605 is not part of customizing Object PDST T.  However, when I proceeded further to use the catalog, I am not able to make any changes and the error message i get is "Data was not sav

  • Using .ocx file in java

    hi i have a ocx file and i want to call the functions in this ocx file from java. can anyone help me in using ocx functions in java program thanking you