Queries and returns the related features/objects that satisfy the criteria.
QueryRelatedObjects(int SourceLayerOrTableID, int[] ObjectIDsInSource, int RelationshipID, string TargetDefinitionExpression, string TargetTableProps, bool GroupBySourceOIDs, SpatialReference OutSR, TimeReference OutTR, ServiceDataOptions ServiceDataOptions)
Parameter |
Description |
SourceLayerOrTableID |
The identifier of the source layer or table. |
ObjectIDsInSource |
The IDs of the features or objects for which related objects are being searched.. |
RelationshipID |
The target layer/table ID. |
TargetDefinitionExpression |
Criteria to select features or objects from related selection. |
TargetTableProps |
Comma separated names of the properties to be returned in the result. |
GroupBySourceOIDs |
If true, the result has related objects sorted by source objects’ IDs, else they are just an array of objects. |
OutSR |
The spatial reference in which to return the results. |
OutTR |
The time reference in which to return the results. |
ServiceDataOptions |
Specifies the format and transport types. |
Return Value
An object of ServiceData type. If GroupBySourceOIDs is false, the returned object contains an array of DataObject elements. If GroupBySourceOIDs is true, it contains an array of DataObjectGroup elements, which has related features or objects grouped by source features’ ObjectIDs.
Remarks
Only the fields that are expressed in TargetTableProps are returned. Setting GroupBySourceOIDs to true returns the results group, but can take longer to process. If you do not need to set the spatial reference or the time reference set the parameters to null.