Tag Info

New answers tagged

2

We have exactly the same case as yours, our production and beta environments are not in our hand and we have to do deployments using WSP solution package (even if those are updates to existing solutions) We also use content types, site columns and list definitions and instances, all declarative.. For the updates (I'm not sure if this is the best method but ...


0

SPContentType wfTask = web.ContentTypes["Workflow Task"]; web.AllowUnsafeUpdates = true; SPList documentLibrary = web.Lists.TryGetList(libraryName); documentLibrary.ContentTypesEnabled = true; documentLibrary.ContentTypes.Add(wfTask); documentLibrary.Update(); web.AllowUnsafeUpdates = false;


1

oList.get_contentTypes() returns a collection and hence it needs to be iterated to get information about each content type. UPDATE var clientContext = new SP.ClientContext.get_current(); var oWebsite = clientContext.get_web(); var collList = oWebsite.get_lists(); clientContext.load(collList, 'Include(ContentTypes, Title)'); ...


2

You cannot update existing Content Type (or list) definitions by installing updated feature that contains updated definitions. You need to add custom code that is run when feature is activated and which updates existing content type and list. The new content type/list definition pair you can add using the same method you did for the first ones earlier - but ...


0

I figured it out. Had to use JavaScript for this. I was able to grab the current item's content type by looking at the ID parameter, grabbing the item based off that and getting its content type. function queryString(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(location.search);return ...


2

I'm actually fairly sure this isn't possible -- and the reason might seem kind of silly, but is a limitation of the architecture having to deal with content types: Forms (edit/view) are associated with a particular content type; so when you go to a list and edit an item, the first question SharePoint asks before it renders any form is 'what content type is ...


0

Man I know this is an old post but I think I have a solution that might be a little easier. My scenario was this. We had a document library with multiple custom content types. We wanted to place a link to the various new content types on the quick launch that would open the client application like Word or Excel So I went to the "New Item" button and chose ...


0

In my case I faced the same issue within a Sandboxed solution. So looks like it is a limitation for sandbox solution.


0

I ran into the same issue, though I wasn't using custom content types. When you create a new calendar from the template, the template overlays are looking for the calendar ID that the overlay is associated with. In my case, I had deleted the original calendar before creating a new calendar from the template. To fix this, go back into calendar overlays and ...


2

The following example demonstrates how to accomplish it via CSOM: /// <summary> /// Hide the content type from List /// </summary> /// <param name="ctx"></param> /// <param name="listTitle"></param> /// <param name="ctName">The name of content type to hide</param> private static void ...


2

You need to set uniqueContentTypeOrder on the root folder of the list. Check SP.Folder.uniqueContentTypeOrder property here at msdn. Even though you need to do it in JSOM or CSOM, I will share a server object model code which may help you in resolving this issue: using (SPSite site = new SPSite("http://aissp2013/sites/t1")) { SPWeb web = site.RootWeb; ...


0

This article helped me finding a solution for my case. While creating new sites I kept receiving these errors after each other without any detailed information: The element of type 'ContentType' for feature '<FEATURE-NAME>' (id: <FEATURE-ID>) threw an exception during activation: Feature Activation: Threw an exception, attempting to roll back. ...


0

This seems to work for me... required a bit of modification and usage of the update() statement is required when modifying item properties: var clientContext, oWebsite, oList, itemCreateInfo, newItm, ctTypes; clientContext = new SP.ClientContext.get_current(); oWebsite = clientContext.get_web(); oList = ...


0

Perhaps this might help as well. As Nadeem mentioned, once you are on the library follow these steps: Library Settings -> click on 'Change the new button order and default content type'. If your content type is not selected, then selected it and choose the order number then click on OK. Click again on 'Change the new button order and default content' and ...


1

Go to List Settings -> Click on Change new button order and default content type. You can control the order with Position from Top:


0

The content type name is already in the error message ContentTypeIdFieldType. You can delete it by going to the Site Settings -> Site Content Type(under Galleries) -> Search and Select the content type. But, this may not help you, because it seems to be used in some list. So, even if you delete this content type, you may continue getting this error. ...



Top 50 recent answers are included