on 12-26-2011 9:18 AM
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?
try to use getType and getString to see what you have
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.