AddManyToDestCollection
Purpose
The CMetaObject class AddManyToDestCollection function adds a list of destination IDs to the collection of this CMetaObject for the specified relationship ID.
Description
AddManyToDestCollection only creates a relationship between the current version of this CMetaObject and the current version of the objects referenced by destIDList or destRelList. If necessary, AddToDestCollection will determine the current version for the current object and each object referenced in destIDList or destRelList.
The relationship ID is specified by the GUID relationship ID or the internal relationship ID (one must be set).
When the variant with destRelList is specified, only the object ID and explanation in each entry of destRelList will be used; the other fields are ignored.
If the destination class of the relationship is a superclass, the destIDList can contain IDs of objects of the destination class type and its subclasses.
Requirements
The internal object id must be set in the object and it must be for a version of the object. CMetaObject must be an object in the origin class and all objects in the destIDList must be in the destination class of the relationship. Each object ID in destIDList and destRelList must be the internal object ID for a version of an object.
Syntax
HRESULT AddManyToDestCollection(
const LLOBJECTID_t &destIDList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
HRESULT AddManyToDestCollection(
const LLOBJECTID_t &destIDList,
const GUID &gRelID,
const OBJECTID_t lRelID,
const bool mergeList);
HRESULT AddManyToDestCollection(
const vector<CMetaRelationshipKey> &destRelList,
const GUID &gRelID,
const OBJECTID_t lRelID,
const bool mergeList);
Argument |
In/Out |
Description |
destIDList |
In |
List of object destination IDs to be added to the destination collection |
destRelList |
In |
List of objects giving a destination ID and an accompanying explanation string |
gRelID |
In |
GUID Relationship ID. Can be set to NULLGUID, if the gRelID is set. |
lRelID |
In |
Internal Relationship ID, optional if gRelID is set |
mergeList |
In |
If true, IDs in the destIDList or destRelList which are already in the collection will be ignored. If false, an error will be returned if there are objects in the list which are already in the collection. mergeList = false is the behavior of the function without the mergeList parameter. |