Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
9 years ago

Federated Item for search dialog

Dears, I have a federated item (A) for search dialog and I have an other single item (B). But when I save the item(B), the item property display "Restricted". It seem to not find the corresponding information.    
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;

3 Replies

  • Hi, You code seems odd. Did you debug it server side to actually see what it does? Can you explain your use case? why do you talk about item A and Item B ?
  • I want to display external database data in search dialog. So I create federated item (ITEM A). Then, I chose the external database data in search dialog and save it (ITEM B). The data has been display “Restricted” in item B. Thanks.
  • My guess is that you used the fully Federated option. In this case, the data does not exist in Aras and Aras has no idea of any ID (no record at all) so it is unable to actually make a link to this external information. This is why it doesn't get the result displayed. You should used the mixed federation mode to make this possible.