Restrict Lookup options dynamically

I have a lookup which options should be filtered by 1 (or more) other fields, that the user enters. So this has to be dynamically.

Easier Usecase:
there is a field “PageCount” and a Lookup with Pages (01,02,03, …). If the user inputs PageCount 8 , the lookup should show only the pages from 01 to 08.

Advanced UseCase:
There are 3 fields - Profitcenter, Datefrom and Dateto:
The Lookup field should show all options of this profitcenter, where datefrom and dateto are within the lookuptables validfrom and validto timespan.

How can I restrict the options per javascript?

Is this possible?
Thanks
Philipp

You may try Dynamic Selection List feature.

That doesn’t work in that context, because the filtering fields are not selects but normal fields or datepicker

That should not the issue. You may simply change the control type under Fields setup, for example, from Select to Textbox.

As you can see from screenshot below, after typing one or some characters in Trademark field, system will display the suggested option from Parent field, and after selecting it, the Child field (Model) will display the corresponding options as expected.

but trademark is still a lookup table. I have date fields which should filter lookuptables

These two date fields define what “distribution logics” should be visible

You better use Client Side Events to add “change” handler to the two date fields and then show/hide other field(s) by the .visible() method of jQuery .fields() Plugin.

ich would have to hide options in the dropdown, not the whole field

Then write your JavaScript to hide the options in your handler for the “change” event.