This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to set multiple related_items?

esteimle - Wednesday, January 11, 2012 2:27 PM:

Reading the docs I found the item method setRelatedItem(item).   Using that I could add one single item under the related item.   I couldn't find a method to set multiple items though.  I tried taking the items I wanted to add and making a item collection out of them but I just got the error that it was not a single item :)

Can anyone tell me what the accepted way to do this is?

Thank you,

-Eric 



aponceot - Wednesday, January 11, 2012 3:42 PM:

Hi Eric,

You can't relate multiple items to a relationship. In aras, the relationship is a "special" item that relates two others.

 

Item > source_id|Relationship|related_id > Item

If you want to create one to many relations, you can simply create multiple relationships :

Item 1 > Rel > Item 2

Item 1 > Rel > Item 3

It's the case for a BOM for example. Just note that a relationship can also have properties to store information on it (quantity for BOMs for example)