cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain parent record from child record in relationship using API

Former Member
0 Kudos

Hi,

I have a record in the main table that is the child in a parent/child relationship to another main table record. Using the Java API, how would I obtain the parent record in the relationship where I am starting with the child record? In the API there seems to just be calls for getChildren, but not a getParent type call.

Appreciate any immediate help that can be provided.

Thanks,

Eddie

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Eddie,

Please follow the below steps to retrieve only parents of a child Record.

1. Create RetrieveRelationshipsCommand.

2. Set the parameter RelationshipId.

3. Set the parameter Anchor Record and Anchor Record Id. In this case the child record for which parents records to be retrieved.

4. Set the parameter setGetChildren as false . This retrieves only the parent records for the specified child reocrd.

5. Execute the RetrieveRelationshipsCommand.

6. Retrieve member records from above step.

Hope it helps

Regards,

Neeharika

Former Member
0 Kudos

Hi,

If the Child node is present in

HierNode taxonomyHierTreeRoot;

then use the command

taxonomyHierTreeRoot.getParent(); -- to retrieve the parent node.

Thanks,

Priya.