cancel
Showing results for 
Search instead for 
Did you mean: 

Insert a qualified look up record using java mdm api

DeeptiChavare
Active Participant
0 Kudos

Hi,

I have a main Vendor table in which Phone Numbers is a qualified look up field.

Phone Numbers table has following fields:

1. Country (lookup field)

2. Phone number (string)

3. Phone extension (string)

4. Mobile (string)

My requirement is to add phone number in the vendor record.

Please guide me how to add a qualified look up record.

Accepted Solutions (0)

Answers (3)

Answers (3)

DeeptiChavare
Active Participant
0 Kudos

Hi,

My problem is solved.

Thanks for your help.

Regards,

Deepti

DeeptiChavare
Active Participant
0 Kudos

Hi,

Thanks for the reply.

Could you please post more detailed code for this?

How do I get qualifiedLookupValue?

Former Member
0 Kudos

I am afraid your question is a bit too general to provide a code sample:

Have you already managed to get a connection to the repository to search the data?

1. Create Repository and User session command for data access

[This is a good place to start.|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8063] [original link is broken] [original link is broken] [original link is broken];

2. Retrieve the record you want to modify the details for

(for instance using RetrieveLimitedRecordsCommand)

3. From the resultset get the relevant record. Get the qualified field value of the record

(use getField returning an MdmValue given a fieldId. Cast this MdmValue to type QualifiedLookupValue).

4. Follow the example of my previous post.

(Code statements there are all you need to add a value to the qualified lookup field)

5. Update the record

(use the ModifyRecordsCommand)

If you have already got this all in place. Let me know in more detail where you are stuck, otherwise the provided link should be a good starting point.

Former Member
0 Kudos

A (multivalued) Qualified lookup field has two parts:

1. Link to a record in another table (containing the non-qualifier fields) by RecordId.

2. Qualifier values.

What I do is the following:

If the combination of values is present in the non-qualifier table entries

get the RecordId recId for the specific record.

Else create new entry and return RecordId recId for this.

I then create a new value for the qualified lookup field:

index = qualifiedLookupValue.createQualifiedLink(recId);

This returns the index for the new field-value. I use this index to set the QualifierFieldValues one by one.

qualifiedLookupValue.setQualifierFieldValue(index,field,qualifierFieldValue);

You can also pass along the QualifierFieldValues in the createQualifiedLink command (through a Map)