cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in getting MDM relationship details using Java Apis

former_member280025
Active Participant
0 Kudos

Hi,

Is it possible to search records which are in relationship using Java Apis? Suppose Record A is Parent record and Record B,C,D ... are child records.

I have to search all the records which are in relationship with record A.

Can any one send code snippet on this.

Regards,

Niraj

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Niraj,

You can use RetrieveRelationshipsCommand api to get the relationship child of the Anchor Record.

RetrieveRelationshipsCommand command = new RetrieveRelationshipsCommand(connectionAccesor);
command.setSession(session);
command.setAnchorRecord(anchorRecord); / command.setAnchorRecordId(anchorRecordId); (use any of the two statements)
command.setRelationship(relationshipId); //For child int type is 10, and for Parent_child int type is 5
command.setMemberResultDefinition(resultDefinition);
command.execute();

//Get Member Records' resuld definition
ResuldDefinition rd = command.getMemberResultDefinition();

Hope this helps you.

former_member280025
Active Participant
0 Kudos

Hi,

Thanks for the response.

I tried to use the code snippet that you have given.

But still I am not able to get the child records. Can you please help me in detail.

Regards,

Niraj

Former Member
0 Kudos

Hi Niraj,

Can you tell me the exact problem that you are facing and at which line are you facing it? Please send in the code also that you are using.

Regards,

Sruti