Content type at web application scope

Hello
Is this possible deploy content type at web application scope feature?
(I want activate content type at all site collections)

You can try exploring content hubs using Managed metadata services
Plan to share term sets and content types in SharePoint Server 2013
http://technet.microsoft.com/en-us/library/ee519603(v=office.15).aspx
Overview of managed metadata service applications in SharePoint Server 2013
http://technet.microsoft.com/en-us/library/ee424403(v=office.15).aspx
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you

Similar Messages

  • How to rename content type on web site level and underneath all the document libraries using powershell?

    Hello
    I wantto rename content type on web site level and underneath all the document libraries using powershell, please let me know how can do this?
    I saw this url
    http://suryapulipati.blogspot.in/2011/08/rename-content-type-name-in-list-using.html, but I want to change everything from Web Site, subsite and underneath document libraries. Because if you try to change on any on document library, it will be applicable
    for that document library, if you change on web level then underneath document libraries content type names not updated automatically.
    Please advise
    Avi

    Not sure with powershell.
    I could help you out with Server Side or Web Services though.
    Brandon James SharePoint Developer/Administrator

  • How do I add content types in the Applications section under Preferences

    I have several applications I use regularly on multiple macs. For specific file types, Firefox 4 will only give me the option to save the file. It does not allow me to select an app to use, and, the file type is not listed in the Content Type list on the Applications tab in Preferences.
    In particular, I have XLS associated with Excel, but XLSX is not listed, so all I can ever do is save it, then open it.
    Another case, on one mac, PDF is associated with Preview, but it is not listed on the other, so again, all I can do is save it. It doesn't allow me the option to change actions.
    There must be a place to change the default behavior for unknown file types, isn't there?

    You can look at this extension:
    *MIME Edit: http://space.geocities.yahoo.co.jp/gl/alice0775/view/20080912/1221150790
    * User Info for White Alice0775: https://addons.mozilla.org/en-US/firefox/user/84420/

  • External content type with web service - new read item operation disable

    Hi,
    i'm tring to create an external content type based on web service.
    I add for test the web service:
    http://www.webservicex.net/globalweather.asmx?WSDL
    when i try to set get reat item operation- it's disabled.
    what should i do in order to create the operations?
    keren tsur

    Hi,
    Please Provide screenshot about your issue.
    For more information about how to create an external content type based on a web service:
    http://msdn.microsoft.com/en-us/library/office/ee556431(v=office.14).aspx
    besides, here are two posts about defining read operation on External content type error, you can take a look at:
    https://social.technet.microsoft.com/Forums/en-US/f86a8f37-7c8c-4cf0-8722-c6d44aa1e3d8/defining-read-operation-on-external-content-type?forum=sharepointadmin
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/4bcc1cd9-a9d6-4171-87d9-c6749543749c/bcs-connecting-to-a-list-in-another-site-collection-using-the-wcf-service?forum=sharepointcustomizationprevious
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • SharePoint 2010 - Create new site collection in existing web application with different existing content DB

    I have a SharePoint 2010 root level site collection SC1 in web application WEBAPP1. I want to create copy of that site collection in same web application WEBAPP1. Apart from Import/Export, Restore/Backup options, will following approach work? If yes , how?
    I took backup of content database of web application.
    Restored database with different name
    Mounted Content database to this WEBAPP1 by assigning new ID to DB
    Created new site collection by using this newly mounted DB
    Site collection gets created successfully but content does not appear.
    Please guide if i can achieve desired functionality by using this approach.
    If this helped you resolve your issue, please mark it Answered

    It is because the Site GUID is identical, and each GUID can only be present on the farm once. You can use Backup-SPSite/Restore-SPSite (which is full-fidelity, unlike Export-SPWeb/Import-SPWeb), which will generate a new GUID for the restore Site Collection,
    even in the same Web App.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • CFHTTP request with content-type "application/atom+xml"

    Is it possible to send a HTTP request (method="post")  with a body that has a set content-type (such as "application/atom+xml")?
    using CFHTTP and CFHTTPPRAM, it seems the tag does not accept a content-type.
    <cfhttpparam type="body" value="#myAtomXML#">
    is there anyway to have CFHTTP , post the body with a given content-type?
    IF NOT, could anyone point me to the right direction to accompolish this using Java?

    Hi,
    Have you tried the "mimetype" attribute of the <cfhttpparam> tag?.
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_g-h_10.html

  • New Web Application not creating correctly

    I'm having an odd occurrence happen about 50% of the time right now when creating new web applications during my migration from SP2010 to SP2013.
    During creating a web application in Central Admin, I can get through the first setup page, then get to the "This shouldn't take long" page and will sit there for 30+ minutes. I end up closing the window and will see that the Web application is there in
    Central admin, and sometimes the DB will be created, other times not, not a big issue since I'm mounting a sp2010 database to this web application.
    What I do notice is that either a IIS site will either not be created at all, or it will be created, but the Virtual Folder is empty. When trying to delete the Web Application through central admin or PowerShell it will hang for hours until the next day
    when it's finally deleted. During this time I am not able to create any other web applications. It's usually at this time that I can successfully create a new web applications but even that is unreliable.
    Has anyone ran into this issue or can suggest any workarounds to get this working? I'm wondering if copying the contents of another web application's virtual directory to the failed web application's virtual directory will be a workaround. I still need to
    verify if creating a web application through PowerShell gives me the same headache but at the moment I'm currently waiting for a web application to delete.

    Finally got this resolved after an 8 hour call with Microsoft. After finally getting the Microsoft SharePoint Foundation Web Application service to restart (took 4 hours) We found that changing the Shutdown time in the Web Application Pool for the Central
    Admin pool to 400 allowed for the Web Application to complete successfully.
    I'm still confused to why everything is taking so long now to complete so i'll have to look into that next.
    Folks, this is a minor problem that seems to be creeping up more and more. I personally have performed over 8 installs in various environments. I have seen this issue in 6 out of the 8 environments I have created. All servers I have tried a variation of
    software. In MOST of my tests, this seems to be a problem. Not sure why they decide to recycle the App Pool just before they perform an "Virtual Directory Copy." Here are the results of my tests. I was very methodical in my testing and made sure these were
    clean downloads every time. As you will see, I tried variations of hardware increases, physical to virtual, database versions and patch levels...etc.
    Test #
    Hardware
    Software
    Server Type
    Install Type
    Problems Creating Web Apps
    Work Around
    Resolution
    1
    HP   Proliant DL360 G6, 16gb memory, 146gb - C, 146gb D (Pagefile), 146gb E, 2   Quad Procs
    Windows   2008R2 (All Patches), SQL 2012 w/SP1, SharePoint 2013 Server
    Physical
    Clean Install and downloads
    Yes
    Copy Contents of Central Admin   Virtual Directory to new Web Application
    Increase Shutdown time to 400
    2
    Host Server = Dell R900 256gb Mem, 146gb   C, 300gb D (Pagefile), 2tb E, 4 Quad Procs; Virtual Guest = 
    100gb - C, 2 Logical Procs, 8gb memory
    Windows 2008R2 (All Patches), SQL 2012,   SharePoint 2013 Server
    Virtual
    Clean Install and downloads
    Yes
    Copy   Contents of Central Admin Virtual Directory to new Web Application
    Increase   Shutdown time to 400
    3
    Host   Server = Dell R900 256gb Mem, 146gb C, 300gb D (Pagefile), 2tb E, 4 Quad   Procs; Virtual Guest = 
    100gb - C, 2   Logical Procs, 8gb memory
    Windows   2008R2 (All Patches), SQL 2012 w/SP1, SharePoint 2013 Server
    Virtual
    Clean   Install and downloads
    No
    4
    Host Server = Dell R900 256gb Mem, 146gb   C, 300gb D (Pagefile), 2tb E, 4 Quad Procs; Virtual Guest = 
    100gb - C, 2 Logical Procs, 8gb memory
    Windows 2008R2 (All Patches), SQL 2012   w/SP1, SharePoint 2013 Server
    Virtual
    Clean Install and downloads
    Yes
    Copy   Contents of Central Admin Virtual Directory to new Web Application
    Increase   Shutdown time to 400
    5
    Host   Server = Dell R900 256gb Mem, 146gb C, 300gb D (Pagefile), 2tb E, 4 Quad   Procs; Virtual Guest = 
    100gb - C, 4   Logical Procs, 16gb memory
    Windows   2008R2 (All Patches), SQL 2008 R2 w/SP1, SharePoint 2013 Server
    Virtual
    Clean   Install and downloads
    Yes
    Copy Contents of Central Admin   Virtual Directory to new Web Application
    Increase Shutdown time to 400
    6
    Host Server = Dell R900 256gb Mem, 146gb   C, 300gb D (Pagefile), 2tb E, 4 Quad Procs; Virtual Guest = 
    100gb - C, 4 Logical Procs, 16gb memory
    Windows 2008R2 (All Patches), SQL 2008 R2   w/SP2, SharePoint 2013 Server
    Virtual
    Clean Install and downloads
    No
    7
    Host   Server = Dell R900 256gb Mem, 146gb C, 300gb D (Pagefile), 2tb E, 4 Quad   Procs; Virtual Guest = 
    100gb - C, 4   Logical Procs, 16gb memory
    Windows   2008R2 (All Patches), SQL 2008 R2 w/SP2, SharePoint 2013 Server
    Virtual
    Clean   Install and downloads
    Yes
    Copy Contents of Central Admin   Virtual Directory to new Web Application
    Increase Shutdown time to 400
    8
    Host   Server = Dell R900 256gb Mem, 146gb C, 300gb D (Pagefile), 2tb E, 4 Quad   Procs; Virtual Guest = 
    100gb - C, 4   Logical Procs, 32gb memory
    Windows   2008R2 (All Patches), SQL 2008 R2 w/SP2, SharePoint 2013 Server
    Virtual
    Clean   Install and downloads
    Yes
    Copy   Contents of Central Admin Virtual Directory to new Web Application
    Increase   Shutdown time to 400

  • Changing content type of xml file to pdf

    Hello,
    I have an xml file (extension is *.xdp) which can locally be opened with Adobe Reader and displays as a regular pdf file. Adobe has a technology that allows xml to be merged with a pdf shell, and thus populating the pdf file with the values retrieved from the xml file.
    My issue is that I want this to be done on an application server level (jboss in particular). In a servlet, I stream the xml file for the contents to be printed out within a browser (IE). I specify the content type to be application/pdf, however, the data is not being displayed within Adobe Reader, but rather as a regular xml file.
    Any help is greatly appreciated. Here is the code below:
    response.setHeader("Pragma", "public");
    response.setHeader("Cache-Control", "max-age=30");
    response.setContentType("application/pdf");
    ServletOutputStream out = response.getOutputStream();
    byte[] fileBytes = readFile();
    out.write(fileBytes);

    Yes, the xml does contain a reference to the shell pdf. This works fine if I do so manually (open the xml file using Adobe Reader). However, through a browser, it seems that the forced content type is completely ignored:
    <?xml version="1.0"?>
    <?xfa generator="XFA2_0" APIVersion="1.4.4127.0"?>
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
    <xfa:datasets xmlns="" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
    <xfa:data>
    <DocRoot>
    <Cldemographics<Cldatecreated>7/21/05</Cldatecreated...
    </DocRoot>
    </xfa:data>
    </xfa:datasets>
    <pdf href="/opt/jboss-tomcat-server-build-4.0.0-2/.../pdfShell/Shell.pdf"
    xmlns="http://ns.adobe.com/xdp/pdf/"/>
    </xdp:xdp>

  • Powershell to add/delete content type to particular library alone in a site collection

    Hi,
    I am trying to add and delete content type from a particular picture library (site collection) using powershell.
    I have tried the below, but it is not working.
    Below scenarios are not working:
    1) If the content type to be added is there in library, then the loop is still moving to "No content type exists".
    2) Content type is not getting deleted from library
    3) Set the newly added content type as default content type.
    Below is the powershell, which I am trying:
    function ChangeContentType($url)
    $site = Get-SPSite($url);
    $web =$site.RootWeb
    $lookForList = "PicLibrary"
    $lookForCT = "Img1ContentType"
    $lookForRemoveCT = "Image2CT"
    write-host "Checking site:"$web.Title
    #Make sure content types are allowed on the list specified
    $docLibrary = $web.Lists[$lookForList]
    if ($docLibrary -ne $null)
    $docLibrary.ContentTypesEnabled = $true
    $docLibrary.Update()
    if (($web.ContentTypes | where { $web.Name -eq $lookForCT }) -eq $null)
    write-host "No content type exists with the name" $lookForCT "on list" $docLibrary.Title
    #Add site content types to the list
    write-host "Adding content type " $lookForCT "on list" $docLibrary.Title
    $ctToAdd = $web.ContentTypes[$lookForCT]
    $ct = $docLibrary.ContentTypes.Add($ctToAdd)
    write-host "Content type" $ct.Name "added to list" $docLibrary.Title
    $docLibrary.Update();
    else
    write-host "content type exists with the name" $lookForCT "on list" $docLibrary.Title
    #Remove Content type
    if (($web.ContentTypes | where { $web.Name -eq $lookForRemoveCT }) -eq $null)
    write-host "No content type exists with the name" $lookForRemoveCT "on list" $docLibrary.Title
    else
    $ctToRemove = $web.ContentTypes[$lookForRemoveCT]
    write-host "Removing content type" $ctToRemove.Name "from list" $docLibrary.Title
    $docLibrary.ContentTypes.Delete($ctToRemove.Id)
    $docLibrary.Update()
    else
    write-host "The list" $lookForList "does not exist in site" $web.Title
    #Dispose object
    $site.Dispose()
    $web.Dispose()
    How to fix this?
    Thanks

    Hi,
    Thanks for the reply.
    I checked it. If the script is run multiple times, the add and delete content type will throw error.
    How to delete content type? I have tried the below:
    $docLibrary = $web.Lists[$lookForList]
    if ($docLibrary -ne $null)
    $docLibrary.ContentTypesEnabled = $true
    $docLibrary.Update()
    #get the content Type
    Write-host "Getting content type $lookForCT in site $web"
    #Confirm that the content type exists.
    $contentType = $web.ContentTypes | where {$web.ContentTypes.Name -eq $lookForCT}
    ##Abort if not found.
    if ($contentType -eq $null)
    Write-host "$lookForCT not found in site collection."
    else
    if ($web.ContentTypes.Name -eq $lookForCT)
    Write-host $docLibrary.ContentTypes.Name
    if($docLibrary.ContentTypes.Name -eq $lookForCT)
    write-host "Content type $lookForCT is already added to list" $docLibrary.Title
    else
    write-host "No content type exists with the name" $lookForCT "on list" $docLibrary.Title
    write-host "Adding Content Type"
    $ctToAdd = $web.ContentTypes[$lookForCT]
    $ct = $docLibrary.ContentTypes.Add($ctToAdd)
    $docLibrary.Update()
    write-host "Content type" $ct.Name "added to list" $docLibrary.Title
    #get the content Type
    Write-host "Getting content type $lookForRemoveCT in site $web"
    #Confirm that the content type exists.
    $contentType = $web.ContentTypes | where {$web.ContentTypes.Name -eq $lookForRemoveCT}
    ##Abort if not found.
    if ($contentType -eq $null)
    Write-host "$lookForRemoveCT not found in site collection."
    else
    if ($web.ContentTypes.Name -eq $lookForRemoveCT)
    Write-host $docLibrary.ContentTypes.Name
    if($docLibrary.ContentTypes.Name -eq $lookForRemoveCT)
    write-host "Content type $lookForRemoveCT is added to list" $docLibrary.Title.
    write-host "Removing Content type $lookForRemoveCT"
    $ctToRemove = $web.ContentTypes[$lookForRemoveCT]
    $docLibrary.ContentTypes.Delete($ctToRemove.Id)
    $docLibrary.Update()
    else
    write-host "No content type exists with the name" $lookForRemoveCT "on list" $docLibrary.Title
    I am getting error in delete now. Error is "Exception calling "Delete" with "1" argument(s): "Specified argument was out of the range of valid values.
    Parameter name: id"
    Thanks

  • Could not parse XMBMessage due to invalid content type for SOAP: TEXT/HTML

    Hi all,
       I am working on a SOAP scenario,
    the soap body is as follows
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
              <m:MT_test xmlns:m="http://titan.co.in/test">
                   <name>String</name>
                   <age>String</age>
              </m:MT_test>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    when i tried to request it using XML spy, following error i am getting ,
    <?xml version="1.0"?>
    <!-- see the documentation -->
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
         <SOAP:Body>
              <SOAP:Fault>
                   <faultcode>SOAP:Server</faultcode>
                   <faultstring>Server Error</faultstring>
                   <detail>
                        <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                             <context>XIAdapter</context>
                             <code>ADAPTER.JAVA_EXCEPTION</code>
                             <text><![CDATA[
    com.sap.aii.af.ra.ms.api.DeliveryException: com.sap.aii.af.ra.ms.api.MessagingException: Could not parse XMBMessage due to invalid content type for SOAP: TEXT/HTML
         at com.sap.aii.af.ra.ms.impl.core.queue.consumer.CallConsumer.onMessage(CallConsumer.java:158)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:916)
         at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
              ]]></text>
                        </s:SystemError>
                   </detail>
              </SOAP:Fault>
         </SOAP:Body>
    </SOAP:Envelope>
    the  request is coming to xi, when i am monitoring the communication channel in RWB,
    i am getting message, "request received, error occured"
    this is anew xi server, is ther any configuration need to do.
    Please help me.
    Regards
    Pradeep P N

    I'm getting the same error. Please tell me how do i resolve this?
    request:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap2soap">
       <soapenv:Header/>
       <soapenv:Body>
          <soap:mt_soapreqsender>
             <years>?</years>
             <interest>?</interest>
             <loan>?</loan>
             <tax>?</tax>
             <insurance>?</insurance>
          </soap:mt_soapreqsender>
       </soapenv:Body>
    </soapenv:Envelope>
    response:
    <!see the documentation>
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>Server Error</faultstring>
             <detail>
                <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                   <context>XIAdapter</context>
                   <code>DeliveryException</code>
                   <text>com.sap.aii.af.ra.ms.api.DeliveryException: com.sap.aii.af.ra.ms.api.MessagingException: Could not parse XMBMessage due to invalid content type for SOAP: APPLICATION/OCTET-STREAM
         at com.sap.aii.af.ra.ms.impl.core.queue.CallConsumer.onMessage(CallConsumer.java:144)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:831)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:79)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:150)</text>
                </s:SystemError>
             </detail>
          </SOAP:Fault>
       </SOAP:Body>
    </SOAP:Envelope>

  • SOAP Adapter Content-Type

    Hi,
    we move a Interface from BC to XI and now the problem come up that the content type isn't correct anymore.
    With BC we Post a request with Content Type <b>application/x-sap.idoc</b> to a specific url.
    With XI i use the SOAP Adapter for sending the Idoc structure but now in the header the Content-Type is <b>application/xml</b> is there any possibility to change this in the SOAP Adapter.
    Or do i have to use another adapter? Somebody has experience with that?
    Regards,
    Robin

    I don't know a standard way to modify the Content-Type.
    You can write a custom adapter module that make this:
    From http://help.sap.com/saphelp_nw04/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/content.htm
    <i>"In the receiver adapter, if you want to add your own modules to process the request message, you add them before the module specified below; if you want to add your own modules to process the response message, you add them after the following module:
    sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean"</i>
    Or you may try to use the HTTP adapter, there you have the control on content-type
    Regards,
    Sandro

  • Setting content-type response header in BlazeDS

    Per this JIRA ticket, http://bugs.adobe.com/jira/browse/BLZ-428 , there is a suggested fix that includes setting the response content-type header to text/xml.
    The JIRA ticket name is
    pinging endpoint Returns a HTTP: Status 200 in ie8
    and the suggested fix is:
    The problem appears to be completely worked around by setting the following headers in our HTTP responses to Flash:
    Content-Type: text/xml; charset=UTF-8
    Cache-Control: no-cache
    What is the best way to do this is if using BlazeDS?
    I have tried to set the content-type within my data service desitnation class, by accessing the HttpServletResponse from the FlexContext class, however this does not work.  The content-type is still "application/x-amf" in the response.    I am assuming that BlazeDS sets the content-type sometime after my data service desination code is invoked.
    I have also tried to create a servlet filter and set the content-type header both before and after (in a finally block) my data service code is invoked, however neither of these approaches successfully ended up with a content-type of "text/xml" in the response.  My sense is that setting the content-type prior to the data service destination code is too early in the chain and setting in the finally block is too late (per the servlet spec you cannot set the content-type after getWriter() has been called).
    Any ideas are appreciated.
    Also any other ideas on how to solve the general IE8 issue described in the bug above are appreciated.
    I am using...
    BlazeDS version: 3.2.0.3978
    Flex SDK version: 3.4
    App Server: JBoss 4.5
    Java: 1.5_16
    Thanks,
    Kevin

    Hi,
    in the meantime I found a "known issue" that seems to be related to my problem but it is said to be fixed with 10.0 MP1 (and we use 10.3):
    ChangeRequest number: CR316761, CR318708
    Description. The servlet container used to append charset=ISO-8859-1 to the HTTP Header contentType in the response for non-JSP pages with any charset contents. This would result in improper display of multibyte characters.
    This problem has been resolved.
    Maybe the information is wrong. I will examine the CR and may apply them on our 10.3 environment but I would be glad if some oracle/bea engineer would intervene here.
    Cheers
    Thorsten

  • SharePoint 2013 Custom Content Type with Site Column custom validations

    Hello,
    Can somebody please suggest me how I can create custom content type with site columns with custom validation to site columns programmatically?
    Thanks,
    Praveen Kumar Padmakaran

    Hi,
    From your description, my understanding is that you want to create content type with site column with validation.
    You could create a site column, and add some validation to the site column. After you could create a custom content type, please add the site column with validation to the content type. Please refer
    to this code below:
    static void Main(string[] args)
    // replace your url
    using (SPSite site = new SPSite("http://sp/sites/sp2013"))
    using (SPWeb web = site.OpenWeb())
    //define the type of the field
    SPFieldType type = SPFieldType.Number;
    // create a site column
    SPField field = CreateSiteColumn(web, "newTest", type, "");
    // add custom formula for the field
    SPFieldNumber fieldNumber = web.Fields.GetField("newTest") as SPFieldNumber;
    fieldNumber.ValidationFormula = "=[newTest]>5";
    fieldNumber.ValidationMessage = ">5";
    fieldNumber.Update();
    SPContentTypeId parentItemCTypeId = web.ContentTypes[0].Id;
    // create custom content type
    SPContentType contentType = CreateSiteContentType(web, "newContent", parentItemCTypeId, "Custom Content Types");
    // add the site column to the content type
    AddFieldToContentType(web, contentType, field);
    // add fiedl to contenttype
    public static void AddFieldToContentType(SPWeb web, SPContentType contentType, SPField field)
    if (contentType == null) return;
    if (contentType.Fields.ContainsField(field.Title)) return;
    SPFieldLink fieldLink = new SPFieldLink(field);
    contentType.FieldLinks.Add(fieldLink);
    contentType.Update();
    // create a custom content type
    public static SPContentType CreateSiteContentType(SPWeb web, string contentTypeName,SPContentTypeId parentItemCTypeId, string group)
    if (web.AvailableContentTypes[contentTypeName] == null)
    SPContentType itemCType = web.AvailableContentTypes[parentItemCTypeId];
    SPContentType contentType =
    new SPContentType(itemCType, web.ContentTypes, contentTypeName) { Group = @group };
    web.ContentTypes.Add(contentType);
    contentType.Update();
    return contentType;
    return web.ContentTypes[contentTypeName];
    // create a site column
    public static SPField CreateSiteColumn(SPWeb web, string displayName,SPFieldType fieldType, string groupDescriptor)
    if (!web.Fields.ContainsField(displayName))
    string fieldName = web.Fields.Add(displayName, fieldType, false);
    SPField field = web.Fields.GetFieldByInternalName(fieldName);
    field.Group = groupDescriptor;
    field.Update();
    return field;
    return web.Fields[displayName];
    You could refer to these articles:
    C# code to create Site Column, Content Type, and add fields to Content Type
    http://spshare.blogspot.jp/2013/10/c-code-to-create-site-column-content.html
    How to do custom validation for site column in SharePoint
    http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-do-custom-validation-for-site-column-in-sharepoint/
    Best Regards,
    Vincent Han
    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].

  • Sun BPEL engine sets wrong Content-Type on calling an external web service

    I have a WSDL for an external web service (which as it happens is running in Websphere locally) and have implemented it as a
    partnerlink on a BPEL diagram in an SOA composite project. The binding style is Document and if you use SOAPUI to test it it
    works fine. Tracing on the web service's server shows the SOAP request coming in. It has a content-type of text/xml, as expected. If I do a JUnit test from NetBeans based on this WSDL alone it also works - same result. BUT if I do
    a full test and call my BPEL process the invocation of this service from BPEL fails.
    On the Test result you see
    BPCOR-6135:A fault was not handled in the process scope; Fault Name is http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling}systemFault;
    (This happens because I did not handle the fault in the BPEL.)
    On the trace I see it now has Content-type of application/xop+xml. Why would the Sun BPEL engine change this? I just
    accepted the usual defaults when I created the PartnerLink and the Invoke. Anyway, the format of the request doesn't match what the WS server expects, so it fails.
    As far as I'm aware I'm just using SOAP1.1. This is NetBeans 6.5 with Glassfish 2.1. I tried with NetBeans 6.7 and it got worse, not better. I would certainly appreciate any advice?
    Thanks

    Perhaps when the BPEL file based process calls the WSDL file to execute,their message communication is not correct.
    the head part in the WSDL file should be manually set to "text/xml", or the IDE or Server will use the default value;
    for example as follow:
    SOAPUI tool would use the default value "text/xml" to request.(depends the tool support).
    NetBeans tool would use the default value "text/xml" to request.
    when you do a full test and you do not set the head "context-type" value ,the WSDL file use the server's default head
    value"application/xop-xml" so that return the contents under the control of the server's default value.
    I hope these will be useful for you.

  • BPEL engine sets wrong Content-Type on calling an external web service

    I have a WSDL for an external web service (which as it happens is running in Websphere locally) and have implemented it as a
    partnerlink on a BPEL diagram in an SOA composite project.
    The binding style is Document and if you use SOAPUI to test it it
    works fine. Tracing on the web service's server shows the SOAP request
    coming in. It has a content-type of text/xml, as expected. If I do a
    JUnit test from NetBeans based on this WSDL alone it also works - same result. BUT if I do
    a full test and call my BPEL process the invocation of this service
    from BPEL fails.
    On the Test result you see
    BPCOR-6135:A fault was not handled in the process scope; Fault Name is http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling}systemFault;
    (This happens because I did not handle the fault in the BPEL.)
    On the trace I see it now has Content-type of
    application/xop+xml. Why would the Sun BPEL engine change this? I just
    accepted the usual defaults when I created the PartnerLink and the
    Invoke. Anyway, the format of the request doesn't match what the WS server expects, so it fails.
    As far as I'm aware I'm just using SOAP1.1. This is NetBeans 6.5 with
    Glassfish 2.1. I tried with NetBeans 6.7 and it got worse, not better.
    I would certainly appreciate any advice?
    Thanks

    Perhaps when the BPEL file based process calls the WSDL file to execute,their message communication is not correct.
    the head part in the WSDL file should be manually set to "text/xml", or the IDE or Server will use the default value;
    for example as follow:
    SOAPUI tool would use the default value "text/xml" to request.(depends the tool support).
    NetBeans tool would use the default value "text/xml" to request.
    when you do a full test and you do not set the head "context-type" value ,the WSDL file use the server's default head
    value"application/xop-xml" so that return the contents under the control of the server's default value.
    I hope these will be useful for you.

Maybe you are looking for

  • Is a MacBook Pro w/ Retina display worth the price?

    Apple community-     Looking at purchasing portability for school- going to work on an MFA in graphics/web/new media, and need some assistance.  I've an iMac from 2007, seems to run flawlessly, but looking at options for taking school with me while a

  • Transport Error: Source system  does not exist. Message no. RSAR203

    Hi, after transporting from BI_DEVELOP to BI_TEST  I get an error whil importing Datasources: Source system ERP_DEVELOP_SOURCESYSTEM  does not exist - Message no. RSAR203 Which is upon the first sight correct, because I  got the followings systems, R

  • Unable to open or reinstall addressbook; icon not showing

    I'm using a Macbook with Tiger (10.4.11). Tried to open addressbook, but noticed the icon is not the typical brown address book, but the generic "A" icon. Clicking on it does not work. I can open my addresses using the widget & using Mail, but cannot

  • How to add a 'Send on Behalf Of' address to multiple mailboxes?

    My apologies if this is a repeat question. I've searched for a while now but haven't come across an answer. This is my dilemma: My company is using a piece of software that has a 'sender address'. This address needs to be added to the users' mailbox

  • Why should Sennheiserr earbuds stop working in my iPhone?

    At the gym this morning my Sennheiser buds stopped working in myiPhone.Sound on the phone is OK. Buds work OK in my iPad, iPod, wife's phone, son's Android etc. Other makes of bud work ok in my phone. My other Sennheisers do not. So its a problem tha