cancel
Showing results for 
Search instead for 
Did you mean: 

What can I do to easily update an item (without having to mention each instance individually)?

Former Member
0 Kudos
  • Given an item that already has many instances in the database

  • When I add a new property to this item

  • I want to have default value (for the new property) for all existing instances

Now, the problems :

  1. in items.xml, when I define the new property, if I use em().getEnumerationValue("NewProperty","someValue"), this will only apply to new instances

  2. in an impex, when I try to update, if I do not include an unique property in the update, it will fail saying that I need a property that is unique

  3. in an impex, when I try to update, if I include an unique property in the update, but I leave the value empty , it will fail saying that the property that is unique needs to have a value

But I want to update all existing instances with a default value for the new property, without having to specify a line in the impex for all unique ids of this item. I already have many instances of this item and I do not want to collect all the values of the unique column to put them in my impex.

What can I do to easily update (without having to mention each instance individually) ?

 UPDATE MyItem;id[unique=true];newProperty
              ;               ;someDefaultValue

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can use batch mode to update all instances of item type. In below example I updated availability of all stock levels in system with value 150

 Update StockLevel[batchmode=true];itemtype(code)[unique=true];available
 ;StockLevel;150    

Answers (0)