Module 1 to many, prefilter

Hello everyone!
I have 3 modules called:

  • Accounts
  • Contracts
  • Subcontracts

Contracts module has a record selector called “customerid” that links to the Accounts module.
Subcontracts module has 2 record selectors:

  • customerid which is linked to the Accounts module.
  • contractid which is linked to the Contracts module.

I’m trying to prefilter the contractid to show every contract that the customerid has but to no avail.
Any help appreciated!

More information is needed.

On which page and on what block are you trying to do this?

Ah sorry!
I’ve created a page that consists of a Record block which is linked to the Accounts module.
I also have multiple Record List modules which are linked to the Contracts module and are referring to the Accounts field.
I’ve added a new Record List which links to Subcontractors module.

You can only filter based on the current open record values. So for example you can prefilter Subcontracts based on the current customerid that is opened.
For example customerid = ${recordID}

If there is a link between some other field of the current record you can use that too.
contractid = ${record.values.ContractField}

Can’t seem to make it work. Tried different things but to no avail.
Let me add more details to the issue:
These are my modules:

Module: Accounts

Name Title Type
customername Customer text input

Module: Contracts

Name Title Type
number Contract Number text input
customerid Customer Record Selector

The customerid record selector has the following properties:
Module: Accounts
Label Field: Customer Name

Module: Subcontracts

Name Title Type
contractid Contract Number Record Selector
customerid Customer Record Selector

The contractid record selector has the following properties:
Module: Contracts
Label Field: Contract Number

The customerid record selector has the following properties:
Module: Accounts
Label Field: Customer Name

My Account page layout when creating/editing a record is like this:

Name Module Type Parent field
Customer Accounts Record block N/A
Contracts Contracts Record List Customer
Subcontracts Subcontracts Record List Customer

What I want to do is whenever I add a record in the Subcontracts record list is to display automatically the Customer associated with it and the Contract Number that are linked to this Customer.
The Customer record selector is automatically displayed correctly.
The Contract Number shows every Contract Number from every customers.

Hope this helps!

Any ideas?
Sorry for the bump.

Have you tried setting a prefilter on your record field?

Something along the lines of customerid='${recordID}' on the customerid field on the Subcontracts module should do the trick

Hello!
Thank you for your reply.
I tested prefilters but to no avail.
The customerid field on the Subcontracts module works correctly.
The contractid filed in the Subcontracts module gives me a hard time, it is either empty or it fetches everything from all customers.

Coming back to this, I still don’t understand where exactly the problem is.
Screenshots or a gif/video of you showing the problem might be helpful.
If you’re not comfortable posting it here, feel free to email it to joze.fortun@crust.tech.