Create link not displaying in hasMany creation form

Hi everyone,
I have a Customer object linked to several Devices (hasMany) and in each Device is linked to a Model with an hasMany relationship also. When I open the add Device form in the Device list, I have the “create new Model” link:
image
But when I want to add the Device from the Customer page, the add link is not there, I simply have the ‘search amoung models’ feature.
Does anybody know how to solve this ?

Hi @theo744 !
Could you share a schema of your tables with their relationships ?
Do you have the link to create a customer when you add a Device ?

Hi @Nicolas_Sailly,

Thanks for the quick answer!

Here’s a schema, it’ll probably much more clearer that way:
image

When I create a device from the device list, I have the ‘add customer’ link, but when i’m creating a customer and want to create a device from inside it, I don’t see the link for creating a new mask or a customer (witch make more sense because I’m curently inside it).

“when i’m creating a customer and want to create a device from inside it”

Ok, so following your schema, customer hasMany device and you want to create device from customer creation form.

Consider this screen:

Here, User has many Usersbooks. We can create new “Users books” from User creation form.

Note that “hasMany” is not in “Details” section but under “related data”
Do you see “CustomerDevice” under related data when you create a new customer?

Hi,

Yes, indeed I can see the devices under ‘related data’. My problem is, inside the device form, i can’t create a new ‘Masque’ object, only link to an existing one. But if I create a device from the device page (and not from inside the customer), I can add a new ‘Masque’ or link to an existing one). Why is that ?

Hi @theo744,

This is currently not possible to create a “double” nested record (BelongsTo from a BelongsTo), so I’m pushing this to our product board.

As a workaround, I think a smart action on your customer collection here would make your life easier if you need to create a lot of new customer with new mask & new device.

Hi @jeffladiray,

Thank you for looking into it. I did’nt think about the smart action but it could indeed be a solution.

Best,