Skip to main content
Solved

Only allow selecting leave nodes in Tree view lookup

  • December 10, 2024
  • 3 replies
  • 58 views

Forum|alt.badge.img+5

We are using a tree view in a lookup popup, and I was wondering if there was a way to only allow selecting the leave nodes.

We use the tree view at multiple locations, one to show a hierarchy with project locations and one to show product types and families.

To also use this view as lookup popup to select products and locations, the user should not be allowed to select product families, and not be allowed to put products in locations with branches,

The default procedure doesn’t seem to have an output parameter which makes it possible to enable / disable the select button, and I was wondering if there was another way to achieve this. ( For example, making the lookup value a column different from the PK and setting it to NULL or something ).    

Best answer by Leroy Witteveen

Hi ​@Daan Heemskerk,

Have you tried setting Subjects → Settings → Tree Type to “Column” instead of “Hierarchical"?
In that type of tree the non leaf nodes aren't selectable.
It only works if you always have the same amount of parents though, as it decides the grouping based on Subjects → Data → Sort → Group until.

Kind regards,
Leroy Witteveen

View original
Did this topic help you find an answer to your question?
This topic has been closed for replies.

3 replies

Leroy Witteveen
Moderator
Forum|alt.badge.img+3

Hi ​@Daan Heemskerk,

Have you tried setting Subjects → Settings → Tree Type to “Column” instead of “Hierarchical"?
In that type of tree the non leaf nodes aren't selectable.
It only works if you always have the same amount of parents though, as it decides the grouping based on Subjects → Data → Sort → Group until.

Kind regards,
Leroy Witteveen


Forum|alt.badge.img+5

I have a tree with a variable depth :-(


Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 653 replies
  • December 20, 2024

Currently, the only way to prevent a look-up record from being selected while also allowing it to be visible in the look-up pop-up (as a parent in the hierarchy) is to clear the value when selected using Default logic. You can notify the user that this value cannot be chosen via a message.

The user will have to re-open the pop-up.

Feel free to submit an idea to allow the user to prevent record selection in a look-up, for instance via LAYOUT logic comparable to the other button types already present (@select_button_type)

Also consider how this affects suggestion and combo look-ups.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings