SharePoint 2010,SandBox Solution,uploaded .STP files to _catalogs/lt using Feature not coming in GetCustomListTemplates

前端 未结 2 1858
耶瑟儿~
耶瑟儿~ 2021-01-26 12:51

I have sandbox solution which has 2 features (both are sitecollection level features) I am activating both feature using same USER.

feature 1 : that upl

2条回答
  •  臣服心动
    2021-01-26 13:29

    If you use the Record Center as the template for your root website in SharePoint 2010, GetCustomListTemplates() will always return 0 (zero).

    There is some weird bug that makes this happen.

    Here is code that you can try running in the SharePoint PowerShell. The return value for GetCustomListTemplates($web).Count will be zero if you have the root web made from the Record Center template.

    $site = get-spsite("http://localhost")
    $web = $site.RootWeb
    $list = $web.Lists["TestDocLibrary"]
    $list.SaveAsTemplate("MyListTemplate.stp", "MyListTemplate", "My List Template", $false)
    $site.GetCustomListTemplates($web).Count
    

    More information can be found at the following web pages:

    • http://social.msdn.microsoft.com/Forums/ar/sharepoint2010general/thread/c5455a27-360a-465c-91d5-f81beeac6789
    • http://sharepointrecordsmanagement.com/2011/02/

    Good luck! - Jason

提交回复
热议问题