0

Choose multiple linked records?

I have a table called Services. Each Service has a one-to-many relationship with Appointments. That is to say, each Appointment can have multiple Services associated with it.

I need a table field on the Appointments form to allow the user to choose multiple Services that will happen during this Appointment.

If I use a Table type field, the user then has the options "Add existing record" and "Create record" (I'm going to remove the option to Create a new record at this point but for now, let's worry about the Add existing record option...)

If the user clicks "Add existing record", they get the list of Services records and can choose one to add to the table.

The problem is, since each Appointment can have multiple Services, it would be far, far better to allow the user to choose more than one Service at a time from the list.

I've tried making the field a Radio Button field and when I do this, each Service is shown in a list on the Appointment form with square checkboxes that the user can use to pick which Services they want. The problem is, the checkboxes don't work.

I need a way to allow the user to pick multiple Services at once that will be associated with this Appointment. How do I do this?

5 replies

null
    • Kent_Signorini
    • 1 yr ago
    • Reported - view

    Answering part of my own question...

    Appointment and Services should actually be a many-to-many relationship: Each Appointment can have multiple Services and each Service can be used in multiple Appointments.

    So now what do I do with that?

    • Fred
    • 1 yr ago
    • Reported - view
    Kent Signorini said:
    Appointment and Services should actually be a many-to-many relationship:

    Then you need a third table that has reference fields to Appointments and Services.

    To your other question:

    Kent Signorini said:
    I need a way to allow the user to pick multiple Services at once that will be associated with this Appointment. How do I do this?

     Take a look at this post.

    • Kent_Signorini
    • 1 yr ago
    • Reported - view

    So I also just found videos on using Dynamic Multiple Choice fields to build a many-to-many relationship that way. Is there any reason why I couldn't do that here and still maintain the functionality I need?

    • Fred
    • 1 yr ago
    • Reported - view
    Kent Signorini said:
    So I also just found videos on using Dynamic Multiple Choice fields to build a many-to-many relationship that way. Is there any reason why I couldn't do that here and still maintain the functionality I need?

     I haven't seen that video so I can't give an opinion on their methods.

    You can use Dynamic MChoice fields to create a links, but they are more like "soft links" rather than the typical links (we can call those hard links) that is created with reference fields.

    The main difference between the two is that with a reference (hard) link you can easily reference all related records in the other table by just using the referenece field name in your formulas.

    If you use Dynamic Choice fields then you will need to put an extra step or three in your formulas to tell Ninox to get the proper records.

    Another limitation of using Dynamic Choice fields as links is that you can't add additional data that would be specific to this case. In your example, you would create a third table (called Appointment Services). You can start with just the two reference fields, but you can add other fields that you can use to track specific information of the appointment or services that is not specific to either appointment or services.

    On a side note: it seems like appointments would be your M:M table that links services to a customer.

      • Kent_Signorini
      • 1 yr ago
      • Reported - view

      Fred 

      OK... maybe 3 tables and hard links is the way to go. But in the end I still need to be able to allow the user to quickly pick multiple items from Services--without having to "Add existing record" for each Service they want to add to the Appointment.

Content aside

  • 1 yr agoLast active
  • 5Replies
  • 155Views
  • 2 Following