The federated item event (On Get):
DBTool dbt = new DBTool();
SqlConnection connection = dbt.getConn("XXX");
Item res5 = null;
Item res = this.getInnovator().newResult("");
try
{
XmlElement resultNd = (XmlElement) res.dom.SelectSingleNode("/*/*/*");
string queryString = "select cname from PLM_XXX";
SqlCommand command = new SqlCommand(queryString, connection);
SqlDataReader customerReader;
customerReader = command.ExecuteReader();
res5 = this.newItem("bryant_customer");
while (customerReader.Read()){
string newid = getNewID();
res5.setID(newid);
res5 = res5.apply();
res5.setProperty("_cname",customerReader.GetString(0));
resultNd.AppendChild(resultNd.OwnerDocument.ImportNode(res5.node, true));
}
customerReader.Close();
} catch (Exception ex) {
CCO.Utilities.WriteDebug("DebugFile",ex.ToString());
} finally {
dbt.closeConn();
}
return res;