Hi everybody,
I'm trying to retrieve category values from a livelink object and I'm affraid I don't get the correct result, so I'm asking you a bit of help.
I get the results from GetObjectAttributesEx, then I list each category field with AttrListNames.
At this point all look fine, I'm able to see the list of keys from the category. But when I try to retrieve the values matching the keys I do not get the correct data: this final step is done using AttrGetValues.
I've past the corresponding code below just in case. Thanks in advance for your help.
I'm trying to retrieve category values from a livelink object and I'm affraid I don't get the correct result, so I'm asking you a bit of help.
I get the results from GetObjectAttributesEx, then I list each category field with AttrListNames.
At this point all look fine, I'm able to see the list of keys from the category. But when I try to retrieve the values matching the keys I do not get the correct data: this final step is done using AttrGetValues.
I've past the corresponding code below just in case. Thanks in advance for your help.
Code:
// input as integer: oid and vcategoryid
int status;
LLValue attrValuePath = (new LLValue()).setAssocNotSet();
LLValue attrValues = (new LLValue()).setList();
LLValue attrValues2= (new LLValue()).setList();
LLValue objID = (new LLValue()).setAssocNotSet();
LLValue catVersion2 = (new LLValue()).setAssocNotSet();
LLValue catID= (new LLValue()).setAssocNotSet();
LLValue catVersion = new LLValue();
LAPI_ATTRIBUTES attr= new LAPI_ATTRIBUTES(session);
objID.add("ID", oid);
catID.add("ID", vcategoryid );
catID.add("Version", 0);
if (doc.FetchCategoryVersion(catID, catVersion) != 0)
{
// display error
return 0;
}
status = doc.GetObjectAttributesEx(objID,catID,catVersion2);
// test status ...
status = attr.AttrListNames(catVersion,attrValuePath,attrValues2);
// test status ...
for(int k = 0; k < attrValues2.size(); k++)
{
String currfield = attrValues2.toValue(k).toString();
status = attr.AttrGetValues(catVersion, currfield, attr.ATTR_DATAVALUES, attrValuePath, attrValues);
System.out.println(currfield + "=" + attrValues.toValue(0).toString());
}
...