Hi,
I'm trying to update, add, and delete attribute sets in a category. I couldn't find an example on how to do this.
I am able to read the value of the attribute set using:
LLValue attrValuesPath = new LLValue();
LLValue attrValuesSet = new LLValue();
if (attr.AttrGetValues(catVersion, "Org Level", LAPI_ATTRIBUTES.ATTR_DATAVALUES, attrValuesPath, attrValuesSet) == 0)
{
String output = attrValuesSet.toString(0);
System.out.println(output);
}
The output I get in this example is:
A<1,N,23=A<1,N,ID=23,Values={Brunei}>,22=A<1,N,ID=22,Values={Asia Pacific}>>
I'd like to update the value Brunei to Australia, so I tried to do the following:
attrValuesSet.setValue(0, LLValue.valueOf("A<1,N,23=A<1,N,ID=23,Values={Australia}>,22=A<1,N,ID=22,Values={Asia Pacific}>>"));
if (attr.AttrSetValues(catVersion, "Org Level", LAPI_ATTRIBUTES.ATTR_DATAVALUES, attrValuesPath, attrValuesSet) == 0)
{
if (docs.SetObjectAttributesEx(objID, catVersion) != 0)
{
System.out.println("Unable to SetObjectAttributesEx: " + dataID);
}
else
{
System.out.println("Successfully updated: " + output + attrValuesSet.toString(0));
}
}
This did not work.
Can anyone tell me how to update an attribute set in this particular example? I also would like to know how to delete or add an attribute set.
I've attached a code snippet of what I have so far.