તમે વિચાર તો “ઉપયોગની માં સાઇટ સામગ્રી પ્રકાર” ભૂલ સામગ્રી પ્રકાર કાઢવા જ્યારે.
આ યાદીમાં / લાઇબ્રેરી માટે મૂળભૂત સામગ્રી પ્રકારમાં ફેરફાર, જે આ સામગ્રી પ્રકાર વાપરે.
પછી સામગ્રી પ્રકાર કાઢવા પ્રયાસ.
|
||||||
ઉપયોગની માં સાઇટ સામગ્રી પ્રકાર - ભૂલ સામગ્રી પ્રકાર કાઢી રહ્યા છે, જ્યારેતમે વિચાર તો “ઉપયોગની માં સાઇટ સામગ્રી પ્રકાર” ભૂલ સામગ્રી પ્રકાર કાઢવા જ્યારે.
આ યાદીમાં / લાઇબ્રેરી માટે મૂળભૂત સામગ્રી પ્રકારમાં ફેરફાર, જે આ સામગ્રી પ્રકાર વાપરે. પછી સામગ્રી પ્રકાર કાઢવા પ્રયાસ. 2 comments to Site Content Type in Use – Error while Deleting Content Typeએક જવાબ છોડો |
||||||
કૉપિરાઇટ © 2024 MSTechBlogs - સર્વાધિકાર સુરક્ષિત દ્વારા સંચાલિત વર્ડપ્રેસ & Atahualpa |
How to find in which libraries this content type is used?
Refer to the discussion in my forum :
http://www.mstechblogs.com/Forums/viewtopic.php?f=8&p=12&sid=cee7f065bed1fc88d9759c66b373d4dd#p12
You can use Object Model to find :
સિસ્ટમ ઉપયોગ કરીને;
System.Collections.Generic વાપરીને;
Microsoft.SharePoint વાપરીને;
namespace Test
{
class ConsoleApp
{
static void Main(શબ્દમાળા[] args)
{
નો ઉપયોગ કરીને (SPSite siteCollection = new SPSite(“HTTP://સ્થાનિક યજમાન”))
{
નો ઉપયોગ કરીને (SPWeb webSite = siteCollection.OpenWeb())
{
// Get the obsolete content type.
SPContentType obsolete = webSite.ContentTypes[“Test”];
તો (obsolete != null) // We have a content type. usages = SPContentTypeUsage.GetUsages(obsolete);
{
IList
તો (usages.Count > 0) // It is in use.
{
Console.WriteLine(“The content type is in use in the following locations:”);
foreach (SPContentTypeUsage usage in usages)
Console.WriteLine(usage.Url);
}
બીજું // The content type is not in use.
{
// Delete it.
Console.WriteLine(“Deleting content type {0}…”, obsolete.Name);
webSite.ContentTypes.Delete(obsolete.Id);
}
}
બીજું // No content type found.
{
Console.WriteLine(“The content type does not exist in this site collection.”);
}
}
}
Console.Write(“\nPress ENTER to continue…”);
Console.ReadLine();
}
}
}
Other Option would be using SQL query (beware its bit risky)
SELECT *
FROM AllUserData
WHERE (tp_DirName LIKE ‘%’)
અને ((tp_ContentType = ‘Document’) and tp_ListId=’C8723B19-0DAB-4F19-B195-3399D5375752′)
You will find items referenced by content type. Delete this referenced items using query below.
DELETE
FROM AllUserData
WHERE (tp_DirName LIKE ‘%’)
અને ((tp_ContentType = ‘Document’) and tp_ListId=’C8723B19-0DAB-4F19-B195-3399D5375752′)