cancel
Showing results for 
Search instead for 
Did you mean: 

Modify MDM Record

Former Member
0 Kudos

HI,

When i am trying to Modify an existing MDM Record in Products Table using 7.1 Java API, i am getting the following error.

Can not update record with modification status NEW

When i directly modify the record in MDM Data Manager, it works fine, but when i try updating the record using Java API, i am getting the above Error. Can anyone advice what's wrong in here, i am using the following code.

ModifyRecordCommand modifyRecordsCommand = new ModifyRecordCommand(connecPool);

modifyRecordsCommand.setSession( usrSessionIdAdm );

modifyRecordsCommand.setRecord(emptyRecordProduct);

modifyRecordsCommand.setModifyAnyway(true);

//Create Record in MDM

modifyRecordsCommand.execute();

On "execute" command, i am getting the error.

Your help is really appreciated.

Thanks

Vijay Budati

Accepted Solutions (1)

Accepted Solutions (1)

Greg_Austin
Active Participant
0 Kudos

Hi Vijay,

Does the Record "emptyRecordProduct" you are passing to the command already exist in MDM? It sounds to me like you are passing a new Record object that doesn't yet exist in MDM so the ModifyRecordCommand is the wrong command to use. Try using the CreateRecordCommand with a new Record.

-Greg

Former Member
0 Kudos

Greg,

Thanks for the reply.

I am using the following code. "emptyRecordProduct" is not but creating an empty record first and then updated values to the fields and then telling to modify the record using "ModifyRecordCommand". As you mentioned, when i use RecordFactory.createEmptyRecord, it might mis-understood that i am trying to create a new record. If this is not the right way to use, could you advice which record i should use?

Record emptyRecordProduct = RecordFactory.createEmptyRecord(tableId) ;

emptyRecordProduct.setFieldValue(...., .....);

//Pass all the required values

ModifyRecordCommand modifyRecordsCommand = new ModifyRecordCommand(connecPool);

modifyRecordsCommand.setSession( usrSessionIdAdm );

modifyRecordsCommand.setRecord(emptyRecordProduct);

modifyRecordsCommand.setModifyAnyway(true);

//Create Record in MDM

ModifyRecordsCommand.execute();

Thanks for your help.

Thanks

Vijay Budati

Answers (1)

Answers (1)

Former Member
0 Kudos

Greg,

Solved.

Actually, I am using the same record which I used to create for modifying too. Now I got the reference from the existing record and modified it and worked.

Thanks

Vijay Budati