Skip to main content

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

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.


Reply