Skip to main content
Solved

Optimizing Lookup and Filtering based on selected values

  • November 5, 2024
  • 1 reply
  • 53 views

Blommetje
Forum|alt.badge.img+13

Hi,

I have a table named 'Activity' that includes a lookup to an 'activity_type'. Depending on the selected activity type, I modify the layout to ensure users input the correct values.

Additionally, there is a lookup to a 'Carriage' table. Based on the activity type, I need to display either incoming or outgoing carriages, and filter these carriages to match the same origin and destination values, which are also fields in the 'Activity' table.

Previously, I managed this by duplicating the 'carriage_id' field and displaying a different field based on the selected values. I then used a trigger to populate the original 'carriage_id' to ensure it is always set.

This approach feels complex and cumbersome.

Are there any more efficient methods to achieve this?

Thank you.

Blommetje

Best answer by Anne Buit

Hi Blommetje,

The look-up to the Carriage table could instead be to a view which combines the activity_type and the carriages, combining the right incoming or outgoing carriages based on the activity type.

This would prevent having to duplicate any data and would remove the need for logic to display a different carriage_id.

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

1 reply

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 637 replies
  • Answer
  • November 14, 2024

Hi Blommetje,

The look-up to the Carriage table could instead be to a view which combines the activity_type and the carriages, combining the right incoming or outgoing carriages based on the activity type.

This would prevent having to duplicate any data and would remove the need for logic to display a different carriage_id.


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