Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
LAPI_ATTRIBUTES.AttrGetInfo sometimes returns wrong type
Bobby_White_(veneti01admin_-_(deleted))
Has anyone run into a problem where LAPI_ATTRIBUTES.AttrGetInfo() indicates that the data type is a boolean, but the value contained is being stored as a String? Calling toBoolean on the value throws a LLIllegalOperationException.As you can see, we've got a workaround for the issue, but wanted to see if anyone else was running into the same problem.try { resValues[j]=Boolean.valueOf(lLField.toBoolean()).toString();} catch(LLIllegalOperationException e) { /* * See if we can natively transform this into a * boolean, otherwise * put the string representation into the result * set. This is just a workaround * for the case where AttrGetInfo() says the * datatype is BOOL but calling toBoolean() * on the value fails. */ String value = lLField.toString(); if(value.equals("1")) { resValues[j] = Boolean.valueOf(true).toString(); } else if(value.equals("0")) { resValues[j] = Boolean.valueOf(false).toString(); } else { resValues[j] = value; }}
Find more posts tagged with
Comments
There are no comments yet