Written by

Integration Analyst at BPlus Tecnologia
Question Guilherme Koerber · May 5, 2022

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

Comments

Eduard Lebedyuk · May 6, 2022

Try:

Set production = ##class(Ens.Config.Production).%OpenId(productionId)
Set item = ##class(Ens.Config.Item).%OpenId(itemId)
Do production.RemoveItem(item)
Set sc = production.%Save()
0
Guilherme Koerber  May 6, 2022 to Eduard Lebedyuk

Perfect, it worked! 

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

0