Related item property in the main search grid?

Hi, maybe it is a silly question but I can't manage it. I have a relationship item "Part Integration" and it has a customized property "integration_number". I want this to be visible in the main Part search grid. I tried to uncheck hidden1 and hidden2 but nothing happens. thank you in advance Duygu
  • Hello, By default, only the properties on the ItemType itself are visible from the main search grid. One workaround to this would be to create a placeholder property on the Part ItemType that always has it's value set to the integration_number of any related Part Integrations. You could do this with some custom logic from an onAfterAdd/onAfterUpdate Server Event on the Part Integration ItemType. Chris
    Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, is there any sample for this? thanks,
  • Hi You can use something like this to show the relationship property on the Parent Item type search grid. Steps:
    1. Create a property in Parent Item Type ( I have created document_created_on in Document Item Type and  made this field as Visible = '0' in Document Form)
    2. Create method with below code and add it to Document Files Item Type (ServerEvents : OnAfterAdd and OnAfterUpdate
    Innovator inn = this.getInnovator(); string doc_createdon =this.getProperty("created_on"); string parentid=this.getProperty("source_id"); Item parent = inn.newItem("Document", "edit"); parent.setAttribute("id", parentid); parent.setProperty("document_created_on", doc_createdon); parent = parent.apply(); return this; If multiple items are there in relationship, then you need to restrict which line item property should be shown in main search grid. Thanks
  • hi thank you, I will try this!
  • Hi again, what if I want to see all "document_created_on" data for a relationship? For example, I have different "integration_number" values for a part and I have to see all in the main search grid. thanks, Duygu
  • Hi, Could you please elaborate the use case. My understanding is you have a part and have Part Integration relationship. Part Integration relationship may have multiple rows and you want to show all the rows integration_number in main search grid ? Do you want all the integration_number as comma separated values in search grid ?  
  • Hi, here is the situation; we have integration parts and 1 Aras part can have multiple integration numbers like E01, E02, etc. I use Part Integration relationship (Part-Part) and add the E values (E_no property) to this relationship. Now, I showed self-service reporting to the project group but they definitely want to see the properties of this relationship on the main search grid. So I think the idea is to see all parts with different E values in the grid like this : Part 1 -E01 Part 1-E02 Part 2-E03 Part 3-E04 thanks
  • Hi,   Related to this ongoing discussion, I am trying to make my code to work, but I have some difficulty. Can you please tell me what it is that I am possibly doing wrong ? I have a method triggered with onAfterAdd and onAfterUpdate server events of a relationship item type named Part Electronic_Config Here is the content of the method ( a simplified version ) Innovator inn = this.getInnovator(); string my_id = this.getID(); Item query = inn.newItem("Part Electronic_Config", "get"); qry.setAttribute("id", my_id); qry.apply(); string created_on = qry.getProperty("created_on"); string source_id = qry.getProperty("source_id); return inn.newError("created_on = " + created_on + " source_id = " + source_id); Result is created on =   source_id = That is to say, variables are all empty. It is obvious that qry is empty. One more question; how can I get the type of the context item ? Using the code lines of string my_type = this.getType() Item query = inn.newItem(my_type, "get"); causes an error saying that  "Neither type nor typeId attribute is specified on tag" Waiting for your valuable help. Özgür.
  • Hi OEAKDEMIR, Few changes in your code will work. string my_type = this.getType(); will give the Item type of the relationship. Innovator inn = this.getInnovator(); string my_id = this.getID(); string my_type = this.getType(); Item query = inn.newItem(my_type , "get"); query.setAttribute("id", my_id); var result = query.apply(); string created_on = result.getProperty("created_on"); string source_id = result.getProperty("source_id"); return inn.newError("created_on = " + created_on + " source_id = " + source_id + " my_type = " + my_type); Result: created_on = 2018-11-14T17:40:48 source_id = 5E99E424500947C9A844B6350A4D9138 my_type = Part Electronic_Config However, you can use the below code to get the created_on, type and source_id of the relationship directly.  Innovator inn = this.getInnovator(); string created_on =this.getProperty("created_on"); string source_id=this.getProperty("source_id"); string my_type = this.getType(); return inn.newError("created_on = " + created_on + " source_id = " + source_id + " my_type" + my_type); Result: created_on = 2018-11-14T17:40:48 source_id = 5E99E424500947C9A844B6350A4D9138 my_type = Part Electronic_Config Both query will return same result.
  • I'm trying to solve this error in the past 1 month and now I'm getting solve this error in my business loan website thanks for helping me stay connected