cancel
Showing results for 
Search instead for 
Did you mean: 

How to create record in Hierarchical table ?

Former Member
0 Kudos

I want to create record that is child of other record, (in Hierarchical table )

or create on same level as some record.

How to implement this in MDM Java API ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please find the sample code.

CreateRecordCommand crRec = new CreateRecordCommand(connections); 
crRec.setSession(sessionId);
crRec.setRecord(createSet); ---> Record set the values of the Hierarchy table.
crRec.setParentRecordId(parentRecId); ---- > Pass the parent record id.
try 
{
       crRec.execute();
} catch (CommandException e) 
{
e.printStackTrace();
}

The above code will create a record in Hierarchy table under the parent record --- parentRecId

Thanks,

Priya.

Answers (2)

Answers (2)

Former Member
0 Kudos

problem resolved according advice

Former Member
0 Kudos

Yes, it almost that I want.

but task appeared to be else - some record is created, but not in relation to parent record,

so I want to make it child after creating - is it possible ?

Or is it possible to modify AutoID typed field ?

(to delete and re-create record with desired Parent ID)

thanks

namrata_d
Active Participant
0 Kudos

hi Vladimir,

In that case you can use "ModifyRecordHierarchyCommand" command.

This command is responsible for changing the location of record in the hierarchy structure. This command is relevant only for the records of hierarchy table

Thanks

Namrata

Former Member
0 Kudos

HI,

Try using ModifyRecordCommand to add the Parent Id.

Thanks,

Priya.