CHunky Universe of Vigourous Astonishing SHarepoint :)

Tag Archives: contenttype

JSOM: Alter a column’s ShowInDisplayForm property

When you create a content type, you can define if your fields will be shown in DisplayForm, EditForm, NewForm. You can hide or show them, just as Yaroslav Pentsarsky says. If your list is already provisioned, you can change them with Server Object Model, why not in PowerShell: Technet: Setting ShowInDisplayForm, ShowInEditForm, ShowInNewForm properties with powershell.

If you don’t have access to the server, then the same can be done with JSOM. Here is the code:

var ctx = SP.ClientContext.get_current(),              //SP.ClientContext
    field = ctx.get_web()                              //SP.Web
               .get_lists()                            //SP.ListCollection
               .getByTitle('MyList')                   //SP.List
	       .get_fields()                           //SP.FieldCollection
	       .getByInternalNameOrTitle("Site");      //SP.Field
ctx.load(field, "SchemaXml");                          //load only SchemaXml
ctx.executeQueryAsync(function() {
	var s = field.get_schemaXml(),
	    s1 = s.replace('ShowInDisplayForm="FALSE"', 

Next: JSOM: Alter a column’s DisplayName.

Content Type Id for Image, Audio and Video

After debugging I have found the Content Type Ids for Image, Audio and Video in the assets library. These content type ids are not present in SPBuiltInContentTypeId.

public class SPBuiltInContentTypeIdExtension
  public static SPContentTypeId Video =
    new SPContentTypeId
  public static SPContentTypeId Audio =
    new SPContentTypeId
  public static SPContentTypeId Image =
    new SPContentTypeId

These three asset content types inherit from Document CT (“0x0101”) and have “0x0101009148F5A04DDD49CBA7127AADA5FB792B” in common, which is the content type id for multimedia content type. So if you want to check if it is a multimedia, use this id.

You can see the content type id when you go to Site Actions – Site Settings – Content Types. Click on a content type you interested in. In the address bar of your browser find ?ctype=.


Eller i koden så kan du göra så här:

var id = properties.Web.AvailableContentTypes


Videokurs om Web Content Management

På finns en ny videokurs om web content management. Där kan du lära dig om hur man implementerar cms-funktionalitet med sharepoint, bl.a.: content types, page layouts med mera. Tack för tipset, deutschsprachige Sharepoint-Community.

Lägga till Företagsnyckelord

Det är enkelt att lägga till kolumnen företagsnyckelord. Skapa egen contenttype och lägg till fieldref.

<FieldRef ID="{23f27201-bee3-471e-b2e7-b64fd8b7ca38}"/>

Funkar utmärkt t.ex. om du ärver ContentTypen från Announcements. Lite svårare är det med Dokument. I själva verket läggs till fler kolumner för att det ska fungera. I Announcements finns de redan. Men i dokument måste du lägga till dem extra:

<!-- Enterprise Keywords-->
<FieldRef ID="{23f27201-bee3-471e-b2e7-b64fd8b7ca38}"/>
<!-- in order keywords to work, two additional fields have to be created-->
<!-- TaxKeywordTaxHTField  -->
<FieldRef ID="{1390a86a-23da-45f0-8efe-ef36edadfb39}"/>
<!-- TaxCatchAll -->
<FieldRef ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}"/>

Utan TaxKeywordTaxHTField uppstår fel av typen: “Kan inte hämta värdet från kolumnen {00000000…}”.

Daniel Chronlund Cloud Tech Blog

News, tips and thoughts for Microsoft cloud fans

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager - Architect, Speaker, Author

Microsoft 365, SharePoint and Azure

SharePoint Dragons

Nikander & Margriet on SharePoint

Mai Omar Desouki

PFE @ Microsoft

Cameron Dwyer

Office 365, SharePoint, Azure, OnePlace Solutions & Life's Other Little Wonders


Me and My doings!

Share SharePoint Points !

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

Aryan Nava

DevOps, Cloud and Blockchain Consultant


SharePoint for everyone


Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint


Mostly what I know and share about...