Trees & Recursion

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Trees & Recursion

Post by PointsWell »

I have a BO called Contact.

Contact can be Person or Company and if Contact is Company it can have:

ps_ParentCo (which is a Company)
pm_Subsidiaries (Companies)
pm_Employees (People - obvs)

I am trying to get a Tree to display the organisational hierarchy but I am completely flummoxed as to how to achieve this given that it is just one object but with pigs ear relationships back to itself.

Which attribute should the Tree be on?
JonP
Posts: 287
Joined: Thu Feb 16, 2017 9:49 pm
Location: United States

Re: Trees & Recursion

Post by JonP »

My answer assumes we are talking about lightweight trees...

Does Contact have a parent BO? You will need to set up the tree using the parent in order to see the 1st level in the hierarchy.

Then in the Contact BO Attributes tab, select your pigs ears and make sure that the Display Attributes property is set the way you want it. I know what you're thinking, "But Jon, that's only the default for a when a form/query is created." Not true. It's also how AIM determines what to use below the 1st level in the hierarchy.

Also, if you plan to use drag/drop and you use the parent BO to expose the 1st level, there is a gotcha you need to know about: https://www.awareim.com/forum/viewtopic ... ilit=+tree

And if you change the relationship between the parent/child BOs to peer as per above, you will need to add a deletion rule to maintain orphan protection: https://www.awareim.com/forum/viewtopic ... ilit=+tree

Hope that helped.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Trees & Recursion

Post by PointsWell »

Ah, therein lies the problem, Contact is the top of the tree...
JonP
Posts: 287
Joined: Thu Feb 16, 2017 9:49 pm
Location: United States

Re: Trees & Recursion

Post by JonP »

Maybe you could setup a fake parent just for that purpose?
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Post Reply