cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Deleting Catalog Items and Category Package Count

I have been testing bulk uploading a lot of catalog items into a dev instance of App Broker, and this involved often deleting catalog items during the process. Rather than going through each one individual in the UI and archiving them, I did a DELETE statement in the WD_WebPackages table. I now realize that might not be the best way of going about it, in part because now the count of catalog items showing in each category in the UI is wrong. The count is much higher than what actually exists because it still includes all of the now deleted catalog items.

Is there a way to update the count to be accurate at this point? And is there also a better way to delete/archive larger numbers of catalog items than the way I did it? Please see the screenshots for reference. 

(1) Solution

Is there a better way to archive catalog items in bulk?  Yes.  The /esd/api.asmx has a method called archiveCatalogItem that will do exactly what you want.  Just write a PowerShell script (or other script of your choice) that reads a list of Package Titles and passes them to that web method.

As for how to clean up your catalog item counts in your categories, try something like this...

DELETE FROM [WD_Package_Category]
WHERE PackageID IN (SELECT PackageID from WD_WebPackages WHERE Deleted=1)

 

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

View solution in original post

(1) Reply

Is there a better way to archive catalog items in bulk?  Yes.  The /esd/api.asmx has a method called archiveCatalogItem that will do exactly what you want.  Just write a PowerShell script (or other script of your choice) that reads a list of Package Titles and passes them to that web method.

As for how to clean up your catalog item counts in your categories, try something like this...

DELETE FROM [WD_Package_Category]
WHERE PackageID IN (SELECT PackageID from WD_WebPackages WHERE Deleted=1)

 

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".
Top Kudoed Authors