I have a form with an EntityReferenceField that uses a view with three filters.

I also created a checkbox on the form that when the user checks it, the filters in the view that populate the EntityReferenceField should be removed and the list of Entities in the EntityReferenceField should be updated.

Any idea how to do this? I Already tried some hooks like MYMODULE_views_query_alter, but no succes.

I'm using Drupal 8.6.2

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.