sharepointwindows-sharepoint-serviceslist-definition

Change document library "Type" after it has been created from list definition


When beginning to develop against SharePoint I did not fully understand all the ins and outs initially. I created a list definition (for a document library) and associated various custom actions to it. Unfortunately, I used the following for the list definition itself:

<ListTemplate...
...
Type="101"
...

And to register the CustomActions against the list:

<CustomAction...
...
RegistrationType="List"
RegistrationId="101"
...

Of course, this means that the custom actions are visible for all document libraries where the feature is activated which is undesirable behaviour. Also, there are lots of these document libraries that have been created from the above list definition in production.

What is the best way to fix this problem? My assumption is that I somehow need to change the "Type" attribute of the already existing lists, but I do not know how to do that. Can it be done via some direct SQL manipulation perhaps? Or is there a better way?

Note: I can see that the AllLists table has a column tp_ServerTemplate, is that the right thing to change?


Solution

  • From some quick initial testing it does look like changing the AllLists table does the trick.

    So steps to resolve:

    1) Change List Definition Type attribute to be a unique value (for example 11000)

    2) Change the CustomAction RegistrationId attributes to be the same (11000)

    3) Update the tp_servertemplate column in the AllLists table to be the new template Type (11000) for all the relevant lists.