cancel
Showing results for 
Search instead for 
Did you mean: 

Create MDM Record in PRODUCTS table

Former Member
0 Kudos

HI MDM Gurus,

Trying to create a new Record in PRODUCTS table, in which lot of fields have lookup values.

Following is the code where i am trying to send a value to "Product Type" field.

emptyRecordProduct.setFieldValue( schema.getField("Products", "ProductType").getId(), new StringValue("Orderable Item")) ) ;

I am getting error: com.sap.mdm.internal.protocol.manual.ServerException: Type mismatch

Thanks

Vijay

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Lakshmi,

The error that you are getting is due to mismatch in type of field where you are sending the value and the Values that you are sending. As you said, you want to save the Material Type which is a lookup field in main table, you need to get the record Identifier for the lookup Value (like R1, R2, etc) usng search apis. You need to pass this record Identifier as follows:

emptyRecordProduct.setFieldValue( schema.getField("Products", "ProductType").getId(), new LookupValue(objRecordId) ;

Hope ths helps!!

Cheers,

Arafat

Former Member
0 Kudos

Hi Arafat,

Thanks a lot for your reply.

Thanks

Vijay

Former Member
0 Kudos

Hi Arafat,

Can you send me the code on how to get the record Identifier "objRecordId" for the lookup Value?

Thanks

Vijay