Question

I am in a situation that i need to create 2 site columns named "Asset Type" of type "Drop-down List" that have the same name (Asset Type), but different choices.

But using the CA UI i can not create 2 site columns that have the same name, and one way to overcome this limitation is to create the site columns using VS.

1) first question. let say i use the following code to create the two site column:-

<Field
  ID="{2690E8BF-0801-408A-8445-93D816DF5D29}"
  Name="AssetType"
  DisplayName="Asset Type"
  Type="choice"
  Required="TRUE"
  Group="Custom Site Columns">
  </Field>

 <Field
  ID="{22E0D583-DC48-45C4-ADC7-098A7289A286}"
  Name="AssetType2"
  DisplayName="Asset Type"
  Type="choice"
  Required="TRUE"
  Group="Custom Site Columns">
  </Field>

so how i need to assign their IDs ? can i enter whatever numbers i want ?

2) second question is it recommended to have two site columns with the same name ? i need this because i want the column label to be "Asset Type"?

3) if it is OK to have 2 site columns with the same name ,, can i do the same to the built-in site columns. so for example can i create a new site column named "Priority" and define different choices compared to the built-in site column named "Priority" ??

Thanks

Était-ce utile?

La solution

Below is your answer of your questions

  1. so how i need to assign their IDs ? can i enter whatever numbers i want ?

Answer: You can assign any IDs to field but note that you should not use same id for two fields. Generally we should use "Create GUID" tool of Visual Studio (Tools => Create GUID => Select Registory Format) to generate random GUID

  1. second question is it recommended to have two site columns with the same name ? i need this because i want the column label to be "Asset Type"?

Answer Generally It is not recommended to give same display name but reason only behind is any user can confuse which column are used where. Suppose you have added one of the column in to any list then if any user come to see list column then user can not get which column is there. For that he need to click on that column and need to see internalname/ID of the column from URL.

  1. if it is OK to have 2 site columns with the same name ,, can i do the same to the built-in site columns. so for example can i create a new site column named "Priority" and define different choices compared to the built-in site column named "Priority" ??

Answer: Yes you can do that also.

Hope it will help to you.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top