1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

delete joined data don't work

Discussion in 'Community' started by cerrani, May 1, 2021.

  1. cerrani

    cerrani New Member

    Level: Community
    Hello everybody

    I am in great difficulty.
    I am using Fabrik and the "delete join data" in the joined lists does not work. In my case in the attachment if I delete for example the first row with code CCCC999 it only deletes the data in the first table xtr_ntx (in my example you see a left join but also with inner join is the same).

    Someone has already had the same problem and what solution they have adopted?

    Do I need to create foreign keys in the tables of my db or is there some other solution?

    Thanks in advance
     

    Attached Files:

  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    In fabrik one of the join's "legs" ('From column' or 'To column') must be a primary key.
     
  3. cerrani

    cerrani New Member

    Level: Community
    I tried it, I changed primary key in db in table 'relazione_ntx_oggetti_antenne' but after i did in the dropdown of primary key
    nothing appears anymore.
    And the insert that previously inserted me correctly in both tables no longer works ...
     

    Attached Files:

  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    Don't change the PK of an existing table.

    Change your setup/design structure so you can use the existing primary keys (autoincrement, integer in Fabrik) in your joins.
     
  5. cerrani

    cerrani New Member

    Level: Community
    so your suggestion is to put in the table 'relazione_ntx_oggetti_antenne' where the code_ntx is equal to the code_ntx of the table xtr_ntx the same id autoincrement of the table xtr_ntx?
     
  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    I don't know your setup.
    It's a restriction in Fabrik that you can't join on two random columns. One of them must be a primary key.
     
  7. cerrani

    cerrani New Member

    Level: Community
    But the primary Key must be only an int autoincrement id or could be varchar,text,etc...?
     
  8. cerrani

    cerrani New Member

    Level: Community
    could there be another way to delete rows of tables that are not joined but that have in common the same value as the field that is going to be deleted?
     
  9. troester

    troester Well-Known Member Staff Member

    Level: Community

Share This Page