Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
8 years ago

Hide / Filter result rows

Is it possible to filter/hide relationship tab rows if one of the fields meets a certain criteria?  For example, if there was a field that was titled "should_we_hide" and if the value was "yes" we would want to hide that result and properties from showing.  If the value was "no" then we would display the result.  Thanks in advance.

8 Replies

  • I think that your best bet to this problem would be to configure the relationship itemtype to not use source access. Turning that off will allow the relationship items to have have their own permissions which you could control using any of the standard aras methodologies (team, state, private permissions, etc).
  • Thanks for the reply!  I am not sure if this is a permission issues (unless I am missing what you meant in your statement). I know there is a way to access the relationship tabs and hide / show columns with an "onFormPopulated" method for the source form.  I am looking for something similar, however, I think I have to go one step deeper and find the results coming back on the relationship.  It could be 1 to many.  As I process the results (loop?) I need to look at each record and see if I need to hide/show the record on a 1 by 1 basis.  I would be looking at a property record to determine if the entire result should be displayed. Let's assume for a customer tab I wanted to ONLY show results that had a customer with a "region" property = "NC", however, there could be other regions ("PA", "NY", "OR", etc) results mixed in.  Is there a way to filter out based on the "region" property? Thanks again for the reply.
  • I was able to make some progress on this one.  As an alternative to hiding the result(s) if they met the criteria, I changed the text of results on that row to red.  The issue is that there is no way, that I have found, for the form to execute the method code in time for it to happen.  I only verified it worked by changing “onLoad” or “onFormPopulated” event to “onMouseOver” for a form event and when I moved the mouse the code would fire.  The “onLoad” event executes before the relationship tabs are populated.  Any thoughts on how I can fire the code with existing form “events” when the form initially loads and each time it updates/reloads?
  • Hello, This blog post covers how to hide a relationship tab in an OnLoad event. Similar to the issue you are seeing, the code that hides the relationship tab needs to wait until the relationship grid is loaded before the tab can be hidden. The sample in the blog post uses a function called isTabbarReady() to determine if the relationship grid is loaded. I have adapted this function into the sample below and included a comment where you should include your row-coloring functionality. If you have any issues adapting this sample for your use case, could you please post the code you have written to color the text of the rows in the relationship grid? Chris ____________________________________ Christopher Gillis Aras Labs Software Engineer
  • Chris, Thanks for the suggestion.  I will work with that and let you know how it goes. Mike
  • Chris, Thanks for the guidance.  My issue is that I had to wait for the tab I needed to load to complete.  So, if the count was zero, I reset the timeout until the results were brought back.  Once that was done the method now executes and colors the rows as needed.
  • Update:  All of my testing was in Google Chrome (where the method works fine).  Users are reporting it is not working in IE unless the item is closed/open.  Any issues reported with tab/row methods behaving differently depending on browser?  Thanks.
  • Hello friends I am stuck in hide and show method.please anybody help me out. I am using below method. //Hide a tab (Form onLoad Event) var tabbar = parent.relationships.relTabbar; var tabid = tabbar.GetSelectedTab(); var tabid = tab.TabId; TabId = tabbar.GetTabId("ABC"); tabbar.setTabVisible("tabid","False"); return tabid; I couldn't see any hidden tab with this method but it gives error like- "Technical Message Event handler failed with message: Unable to get property 'relTabbar' of undefined or null reference Stack Trace- Client Side Error"