Uderc programming article aggregator sites

Remote Key Manupulation in Java MDM APIs

Answers: Have 5 answers
Hi ,
I need to do create/Modify/retrieve remote key using MDM Java APIs. I have found out two APIs for retrieve and modify of remote key (RetrieveRecordsKeyMappingsCommand and ModifyRecordsKeyMappingsCommand using RecordKeyMapping).
I am not getting any API to create remote key using Java APIs. Can anyone help me in this regard.If anyone has sample code also that would a great help.
Thanks and Regards,
The best answer: Hi,
Please have a look on below code ...
          TableId tableId = schema.getTable("table Code").getId();
RecordId recordId = new RecordId("R1"); // record id of record to which you are going to add key mapping
          /Remote System Properties/
          RemoteSystemProperties remoteSystem = schema.getRemoteSystem("RemoteSystemCode");
          /*Creating new instance of RecordKeyMapping */
          RecordKeyMapping recordKeyMapp = KeyMappingFactory.createRecordKeyMapping(tableId,recordId);
          /*Creating new instance of KeyMapping */
          KeyMapping keyMapping = KeyMappingFactory.createKeyMapping(remoteSystem.getId());
          /*Setting value to Key value */
          /storing keymapping instance in RecordKeyMapping instance/
          RecordKeyMapping [] recordKey = ;
          ModifyRecordsKeyMappingsCommand rkm = null;
          try {
           rkm = new ModifyRecordsKeyMappingsCommand(context);
          } catch (SessionException e) {
          } catch (ConnectionException e) {
          try {
          } catch (CommandException e) {
Hope this helps you.