Hi, I'm wondering if anyone here can help share information on how to add rows to an attribute set using EWS?
I've used EWS before to add attributes to new/existing Livelink documents, but never had to deal with sets.
Thanks, Hiren
Hi Hiren,
Many thanks Jason!!
Guys anyone used to TableValue as RowValue to insert Multirow set Attributes? I am able to create required rows except I was unable to increase row ID, hence all the rows have values of the first row. I will be nice if someone tweaked this code and tell me what I am doing wrong?
private void processMultiRowSetAttributes(TableValue tableValue, DataTable table) { RowValue temprowval = tableValue.Values[0]; RowValue[] RowValues = new RowValue[table.Rows.Count]; for (int jcount = 0; jcount < table.Rows.Count; jcount++) {
RowValues[jcount] = temprowval;
//Somehow all the row ID for attributes remain same of the first row... Any ideas to insert new rows?
} int ICount = 0; foreach (DataRow row in table.Rows) { foreach (DataColumn column in table.Columns) {
foreach (DataValue foundDataValue in RowValues[ICount].Values) { if (foundDataValue.Description.Equals(column.ColumnName)) { string Datatype = foundDataValue.GetType().Name; switch (Datatype) { case "StringValue":
DocumentManagement.StringValue stringvalue = (DocumentManagement.StringValue)foundDataValue; if (stringvalue.Values == null) { stringvalue.Values = new string[1]; } stringvalue.Values[0] = row[column].ToString(); break; case "BooleanValue": DocumentManagement.BooleanValue booleanvalue = (DocumentManagement.BooleanValue)foundDataValue; if (booleanvalue.Values == null) { booleanvalue.Values = new bool?[1]; } booleanvalue.Values[0] = Convert.ToBoolean(row[column]);
break; case "IntegerValue": DocumentManagement.IntegerValue integervalue = (DocumentManagement.IntegerValue)foundDataValue; if (integervalue.Values == null) { integervalue.Values = new long?[1]; } integervalue.Values[0] = Convert.ToInt64(row[column]);
break; case "DateValue":
DocumentManagement.DateValue datevalue = (DocumentManagement.DateValue)foundDataValue; if (datevalue.Values == null) { datevalue.Values = new DateTime?[1]; } datevalue.Values[0] = Convert.ToDateTime(row[column]);
break; } } } } ICount++; } tableValue.Values = RowValues;
}