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