Rado R

This is a very rookie question, but I was wondering if anyone knows where I can find the GUIDs of the fields of a particular content type. Say I want to lookup the TaskStatus field of a task .. how do I find its guid I can easily find the ID of a content type by going to its page in WSS and looking at the URL, but the same does not apply for fields.




Re: SharePoint - Development and Programming Field GUID

Rado R

Hasn't anyone here needed to add fields to custom tasks




Re: SharePoint - Development and Programming Field GUID

MKeeper

You can find all of the "out of the box" Content Type definitions and Site Columns (a.k.a. Fields) in the Features Folder (..\12\Template\Features).

Content Types are in a Feature called "ctypes" and Site columns are in a Feature called "fields".

DO NOT MODIFY THESE FEATURES .. JUST READ THEM AS A REFERENCE

If you are wanting the value of a List Item though, you don't have to pass in the GUID, you can also use the Internal Name.

e.g..

Code Block

string strTitle = myListItem["Title"];

You can find the "Internal Name" by going to the Document Library / List Settings page.

You should find a list of the columns. Click on the column and it will take you to the "Edit Column Details" page.

Look in the URL and you should find a "field=" attribute.

That is the "Internal Name".

Quite often you will find that they do not match the "display name".

e.g. I think "Last Modified" internal name is actually "author" .. or something very similar.






Re: SharePoint - Development and Programming Field GUID

MKeeper

oh .. ps ... Content Type IDs are not strictly GUIDs ...

the structure is a kind of hexadecimal value.

Basically .. each "out of the box" Content Type consists of a 2 digit value (with the exception of "System" which is "0x").

Each "child" item consists of the {Parent ID + "2 digit value"}

So ...

0x = System

0x01 = Item (inherits from System)

0x0101 = Document (inherits from Item)

0x0120 = Folder (inherits from Item)

However .. if you want to create CUSTOM content types .. then you have to do something different.

For the first Custom Content Type you need to use: {Parent ID + "00" + GUID}

(note - the guid must have { } and - removed)

So ... if you wanted to create a "Custom Document" content type .. you could use:

0x010100734D49BD9CF147d59FA7EA2EA959FA72

However .. if you then wanted to create "Child of Custom Document" content type, (i.e. a child of your custom one) then you only need to use: {Parent ID + 2 digit value}

For example:

Document = 0x0101(inherits from Item)

Custom Document = 0x010100734D49BD9CF147d59FA7EA2EA959FA72 (inherits from Document)

Custom Sub Document 1 = 0x010100734D49BD9CF147d59FA7EA2EA959FA7201 (inherits from Custom Document)

Custom Sub Document 2 = 0x010100734D49BD9CF147d59FA7EA2EA959FA7202 (inherits from Custom Document)

Don't ask me why they made this so damned confusing ... they just did Wink




Re: SharePoint - Development and Programming Field GUID

Rado R

Thanks, man. That's what I was looking for! Big Smile




Re: SharePoint - Development and Programming Field GUID

huda albar

Dear all,

i need your help plesae can you help me how can i craete GUID for the lists on sharepoint is there codind or any soluttion please tell me

thanks






Re: SharePoint - Development and Programming Field GUID

Rado R

You want to create a new GUID If so, in Visual Studio, go to Tools->Create GUID and you want to choose "Registry Format". Then just press Copy and you can then paste it in your code.