2009-08-24 82 views
0

我有這個功能的SharePoint:功能基礎

<?xml version="1.0" encoding="utf-8"?> 
<Feature Id="c54f20d8-1ad1-49b8-aff7-2c874dd2f45a" 
      Title="MyCompany Content Types" 
      Description="Content Types required for MyCompany Provided Applications and Functionality" 
     Version="12.0.0.0" 
     Hidden="FALSE" 
     Scope="Site" 
     DefaultResourceFile="core" 
     xmlns="http://schemas.microsoft.com/sharepoint/"> 
    <ElementManifests> 
    <ElementManifest Location="siteColumns.xml"/>  
</ElementManifests> 
</Feature> 

這裏是siteColumns.xml

<?xml version="1.0" encoding="utf-8" ?> 
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> 
    <Field 
    ID="{1F343F02-22D9-45b8-A2A8-CEB2619A28C4}" 
    Name="AllowSubstDelivery" 
    DisplayName="AllowSubstDelivery" 
    Type="Boolean" 
    Format="TRUE" 
    Group="MyCustomGroup" 
    /> 
</Elements> 

該功能安裝並激活,不會產生錯誤的內容,但siteColumn是無處被發現,爲什麼這個網站列不可見的任何想法?

我檢查了日誌,也沒有報告錯誤。

回答

1

嗯......看起來你已經做得很對。你是否從任何地方複製並粘貼了Field的ID?如果是這樣,該ID可能已被使用,導致您的字段規定被忽略。

我發現創建功能的最佳方式定義站點欄和內容類型是使用Web界面對所有內容進行原型製作,然後將生成的CAML複製並粘貼到Visual Studio項目中。我錄製了一段短片,展示您可能會發現有價值的過程。

SharePoint Site Columns and Content Types via a Feature

+0

毫無疑問Rob是我在SharePoint上見過的最有用的視頻。如果您有更多視頻,請分享鏈接,我會非常感興趣的收看更多。 – 2009-08-24 16:45:12

0

Format =「TRUE」是什麼意思?

看起來不像是根據文檔。

Field Element Documentation並沒有告訴你有關這些屬性的很多內容,但與FieldRef element有許多共同之處,它具有有關Format屬性的文檔。

也許你想使用DefaultValue屬性?