1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

Avoid duplicate entries

Discussion in 'Community' started by Mono, Jun 22, 2019.

  1. Mono

    Mono Member

    Level: Community
    I am using a database join to join two tables as a one to many. tables 'customer' & 'operator'.

    A customer can have many operators.

    I have an 'operators' form with a database join to customer id and a repeat group for operator details.

    Once a customer has had operator details entered, how do I prevent the user clicking 'add' and creating a duplicate of the original.

    I would prefer that if when the user clicked 'add' and there is already an operator, that record would be displayed.
    Is this possible?
  2. pyberg

    pyberg New Member

    Level: Community
    Have you made a unique index for the database column. It will then be impossible to enter the same value twice.
  3. Mono

    Mono Member

    Level: Community
    I'm not just sure what you mean, both tables have a primary key.

    I could validate on uniqueness, but still I could end up with 'almost' duplicate records.
    eg customer ______ _____operator
    1 Pacific Rail___________1 Fred Smith
    1 Pacific Rail ___________2 Frederick Smith

    If the user comes to enter Frederick Smith and isn't expressly shown that Fred Smith has already been entered for Pacific Rail.
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    There's an "areuniquevalues" validation to validate a combination of elements.
    Mono likes this.
  5. bea

    bea Active Member

    Level: Community
    I am not sure, if this is the correct hint:

    Menu list/data/joins: You can select 'Merge rows and reduce data'

    Attached Files:

    Mono likes this.

Share This Page