cancel
Showing results for 
Search instead for 
Did you mean: 

MdmValue object of an Auto ID field

Former Member
0 Kudos

Hi all!

While developing a MDM WD component I've encountered the following problem.

I have a field in my table of an Auto ID MDM type.

I'm retrieving that field with

MdmValue fieldIDValue = wdThis.wdGetItemDetailsCompInterface().getFieldValue("AUTO_ID_FIELD");

Now I need to get actual value of the field in integer variable. I know that I must cast MdmValue object to an object of corresponding type which implements MdmValue interface to do that.

So here is the issue. I tried to cast fieldIDValue to IntegerValue, DoubleValue, StringValue. For example, like that:

IntegerValue fieldIDIntegerValue = (IntegerValue)fieldIDValue;
int actualValue = fieldIDIntegerValue.getInt();

But no casting to any of those objects worked. I'm always getting a kind of type mismatch exception. So the question is: Whith what actual type of MdmValue is Auto ID field represented?

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

try to use getType and getString to see what you have

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks a lot. That is resolved. The problem was that getFieldValue method returns field not from MDM but from the ItemDetails input form. So after adding AutoID field to that form I'm not getting exceptions any more. Though unfortunately getting nulls instead (that's natural, cause Auto ID gets populated automatically inside MDM on record creation.)