hi
how to delete item from custom table with kentico API??
i user from this:
DataSet dataSet = CustomTableItemProvider.GetItems("doc.OfflineRequestLog").Columns("Di"); foreach (DataRow row in dataSet.Tables[0].Rows) { CustomTableItem deleteCustomTableItem = CustomTableItem.New("doc.OfflineRequestLog", row); deleteCustomTableItem.Delete(); }
but gives me an error message => Error: [BaseInfo.Delete]: Object ID (ItemID) is not set, unable to delete this object.
Is there another way?
You can try adding ItemID to .Columns() or removing .Columns()
DataSet dataSet = CustomTableItemProvider.GetItems("doc.OfflineRequestLog").Columns("Di,ItemID");
DataSet dataSet = CustomTableItemProvider.GetItems("doc.OfflineRequestLog");
Please, sign in to be able to submit a new answer.