I have a requirement where the user needs to be able to create records in Model ‘A’ and records in Model ‘B’ where one of the fields in Model ‘B’ is a lookup to Model ‘A’.
This is a relatively straightforward scenario when the records in Model ‘A’ already exist in the database and/or can be saved prior to creating the records in Model ‘B’. Unfortunately, my scenario is not that simple. The requirement is that records in Model ‘A’ and Model ‘B’ are created by the user and then everything saved to the database. Additionally, using drawers to provide context on ‘A’ when creating ‘B’ is also not possible due to UI/UX reasons for this use case.
The page layout is:
1) Table of records in Model B
2) Global Action on table that displays a popup for creating a record in Model ‘A’
3) Field in table on Model B that is a lookup to Model A where the user can choose any record that they’ve created in Model A
All “searches” on lookup filters expect the data to exist in the database. Is there a way to have a lookup field use records from a client side model that has new records?
The reason the page must behave this way is a couple-fold:
1) In the real solution, there is actually two fields on Model B, one that looks up to Model A and one that looks up to Model Z and both A & Z will be “new” records created via a popup
2) Model A & Model Z can’t be saved as they are ‘created’ because everything must be saved or cancelled - all or nothing type of behavior
3) the page is incredibly complex and drawers introduce too much additional “clicking” and the need to take up additional real-estate that would otherwise be unnecessary.
4) Since there are two models (A & Z) and any combination of these two records is valid to assign to Model B records, drawers wouldn’t provide that level of context anyway.
Any assistance on how to approach this is greatly appreciated!
Question
Choose a lookup field value from 'new' records that exist in another model

This topic has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.