Guilherme Koerber · May 5

Delete item in production

Hello community!

I'm creating a script to remove an item (component) from the Ensemble production, I know there is a manual way to do it but as there are several components the idea is to use a script to be faster.

I tried using %Delete() and doing a select on Ens.Config.Item, but this ends up generating several errors in production. Does anyone have any idea how I can do this simply?

Product version: Ensemble 2018.1
0 111
Discussion (2)2
Log in or sign up to continue


Set production = ##class(Ens.Config.Production).%OpenId(productionId)
Set item = ##class(Ens.Config.Item).%OpenId(itemId)
Do production.RemoveItem(item)
Set sc = production.%Save()

Perfect, it worked! 

I didn't know there was a RemoveItem() method. Thanks Eduardwink