我有以下代码: ReportDetails有7个不同的属性。但是这段代码似乎不起作用,并且没有错误。
AttributeGroup DocTypeGrp = new AttributeGroup();
DocTypeGrp = docManClient.GetCategoryTemplate(ref otAuthentication, 12456);
StringValue doc = new StringValue();
doc.Values = new string[1];
doc.Values[0] = "Report";
DocTypeGrp.Values[0] = doc;
AttributeGroup rptDetailsGrp = docManClient.GetCategoryTemplate(ref otAuthentication, 45632);
StringValue rptGroup = new StringValue();
rptGroup.Values = new string[1];
rptGroup.Values[0] = string.Empty;
// rptGroup.Values[1] = "2012";
rptDetailsGrp.Values[0] = rptGroup;
rptGroup = new StringValue();
rptGroup.Values = new string[1];
rptGroup.Values[0] = "2012";
rptDetailsGrp.Values[1] = rptGroup;
Node existingNode = docManClient.GetNode(ref otAuthentication, reportFolder.ID); // Set Node
Metadata metadata = new Metadata(); //Create Metadata object
metadata.AttributeGroups = new AttributeGroup[] { DocTypeGrp , rptDetailsGrp };
existingNode.Metadata = metadata; // Set the Metadata objects back onto the node
docManClient.UpdateNode(ref otAuthentication, reportFolder);//Update Node真的很想得到任何帮助。
发布于 2016-11-27 20:59:57
由于您要将类别添加到existingNode对象,并且在更新节点时,您传递的是不包含类别的reportFolder。
如下所示更改代码应该可以解决您的问题
docManClient.UpdateNode(ref otAuthentication, existingNode);//Update Nodehttps://stackoverflow.com/questions/40006341
复制相似问题