cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup Table field value from Main Table record using MDM java api

0 Kudos

Hello All,

i am retriving data from main table and and i have to retrive some lookup table value from main table record.

i am using following code but i am getting record id for the lookup table.

String value = null;

value = maintableRec.getFieldValue(fieldId).toString(); // Return R4 i.e record id.

I have read many thread and most of the thread suggest use getLookupDisplayValue()   i.e. value = maintableRec.getLookupDisplayValue(fieldId);

i tried it and it is giving me correct Value instead of record id.But most of thread many users failed to get correct value they are getting null value or Record id only.

So i just want to confirm that when we want to get field value of lookup table from main table record , so what is the correct method getFieldValue(fieldId) or getLookupDisplayValue(fieldId)?

I dont want write code in such impression that i am getting value from getLookupDisplayValue(fieldId); so this method is correct.

Please confirm.

Regards,

Aditi

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

don't know why you are confused with these two methods

one gives u the record id, another gives u the display value, they are totally different thing.

what u want?

0 Kudos

Hi Jun Wu,

i just want to clear my doubt when i am retriving record from main table and from that main table record i want to retrive lookup table value which is used in main table then what is the method to get its value?

For examplae..

Employee structure(main Table)

Name | age    | DOB                 | City(lookup Table)

Test1     30     23/8/1979              A01

City Structure (lookup Table)

Code | City Name

A01     Mumbai

A02     Pune

So now i am retriving data from main table using RetrieveLimitedRecordsCommand and getting Record.

So now my question is to get lookup table value from main table record which method should use?

Regards,

Aditi

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi Aditi,

you need to use getLookupDisplayValue(fieldId)...and this works as we have used this enormous times. this will get you display value i.e. A01 etc..

getFieldValue(fieldId) will return the record id of this looked up record ...e.g. R1 etc..this wont get you the display value i.e. the sensible value..

-Abhijeet

Former Member
0 Kudos

Hi All/Jun Wu,

I have similar requirement to retrived the display value from Look table.

I have used Search, Item details and Result set std DCs.

I configured event handler subscribing the even "recordloaded" and added te below code.

wdThis.wdGetMDMItemDetailsInterface().getFieldValue("country").toString();

it returns me some value like R11, R3 etc..

I want to retrive the country name which is like " AR,Argentina"..

Please help me.

Regards

Nithya

Answers (0)