cancel
Showing results for 
Search instead for 
Did you mean: 

KeyMapping with Java API2

Former Member
0 Kudos

Hello,

does anybody know how it is possibly to set/create a key mapping with the know Java API2, if no key mapping for a record exists.

Regards,

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can try this:

// create command object

...

// create RecordKeyMapping

RecordKeyMapping keyMapping = new RecordKeyMappingImpl(tableId, recordId);

// set remote key with RemoteSystemId and key value

keyMapping.addKeyMapping(new KeyMappingImpl(remoteSystemId));

keyMapping.addKey(remoteSystemId, keyValue);

command.setKeyMappings(new RecordKeyMapping[] );

command.execute();

Hope this helps!

Answers (3)

Answers (3)

Former Member
0 Kudos

it's working fine

thanks

Former Member
0 Kudos

Hallo,

I use the ModifyRecordsKeyMappingsCommand. But you have to use modifyRecordsKeyMappingsCommand.setKeyMappings(recordKeyMapping) for to add the key mapping. The problem is, that I don't find a solution to initialize recordKeyMapping, if the key mapping for this record does not exists before. If there is a key mapping before it is working without any problems.

Thanks

Thomas

Former Member
0 Kudos

You can use ModifyRecordsKeyMappingsCommand.