0
votes

The context here is that we are building a simple standalone MVC-frontend to a Sharepoint Server installation (for political reasons) connecting by CSOM API.

We have defined some content types at site level which we use in different document libraries and lists on our site.

When you add a Content type to a document library or a list the Content type is copied to the doclib/list and gets a new guid.

The new guid is normally on the form

Parent Content Type ID + "00" + Hexadecimal GUID 

We want However, if you do a search then the returned document type is the actual Content Type defined at site level.

This means that we can't use the id from the resultrow to do a getContentTypeById().getName() in order to find the actual name of the content type of the result row.

Somehow I need to be able to find the parent (actual) content type of the result row based on the child contenttype with guid

Parent Content Type ID + "00" + Hexadecimal GUID 

In other words how can I get:

Parent Content Type ID

from

Parent Content Type ID + "00" + Hexadecimal GUID 
1

1 Answers

0
votes

Parsing the content type ID to determine the name of a parent content type seems like an unnecessarily complicated approach.

If you're able to acquire a Content Type object from a list item in the Client Side Object Model, you can then retrieve its .Parent property to see its parent content type and any associated data.