Querying Related Records

You can query for related records for a given Parent record and relationship name. You can also specify a paging element using the <StartCount> and <MaxCount> elements.

Procedure

  1. Specify the user name, password, and enterprise for a user in the request criteria.
  2. Specify Command="Query" and command qualifier="RelatedRecords".
  3. Specify the following mandatory input parameters in the <ParentRecordData> element:
    • Repository Name
    • ProductID and ProductIDExt
    • UOM
    • Record version
    • Relationship Name

      (OR)

    • Repository Name
    • ProductKeyID
    • Record version
    • Relationship Name

      For example,

      <ParentRecordData>
      				  <Record>
      					       <ExternalKeys>
               	<Key name="MASTERCATALOGNAME" type="string">CUSTOMER</Key>
               					<Key name="PRODUCTID">a1-relA</Key>
      					         <Key name="PRODUCTIDEXT">a1-relA</Key>
      					         <!--Key name="PRODUCTKEYID">10001</Key-->
               					<Key name="RECORD_VERSION">3</Key>
      					       					</ExternalKeys>
      								  </Record>
      </ParentRecordData>
  4. Specify the relationship details in the <RelationshipData> element:
    • <RelationType>: Specify the Relationship name to return related records for the specific relationship or specify ALL to return all the relationships related to the record.
    • <RelationDepth>: Specify the relationship depth in numeric to control the depth of the bundle heirarchy.

      For example,

            <Return>
             <RelationshipData>
              <Relationship>
                <RelationType>CUSTOMERADDRESS</RelationType>
                <RelationDepth>1</RelationDepth>
              </Relationship>
              <Relationship>
                <RelationType>ALL</RelationType>
                <RelationDepth>3</RelationDepth>
              </Relationship>
             </RelationshipData>
            </Return>
  5. Invoke the webservice by specifying the endpoint URL as:
http://<servername>:<port>/eml/services/router/MasterCatalogAction

    The Response message contains a list of related records.