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

Copy form with new BD table - SOLVED

Discussion in 'Community' started by HyperOsmar, Apr 9, 2021.

  1. HyperOsmar

    HyperOsmar Member

    Level: Community
    Dear,

    Is it possible to copy an entire structure (List, Form, Group and Elements) but using another database table ??? ...

    I already have a form for course "A" ready, and I want to take the opportunity to copy to course "B", but creating a new table ...

    I thank everyone...
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
  3. HyperOsmar

    HyperOsmar Member

    Level: Community
    troester, good afternoon ...

    After performing the steps described in the link, the following message appeared:

    ERRO
    Sorry we can not create content types with cascadingdropdown element plugins
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    Oh, I didn't know.
    Maybe you can change your CDD to a dbjoin at least for the export (note your settings for restoring the CDD afterwards).
    CDD is complicated anyway. In many cases it's easier and more flexible to use a dbjoin with a Data-where using an element placeholder (the "watched" element) and Ajax update enabled.
     
  5. HyperOsmar

    HyperOsmar Member

    Level: Community
    troester,

    I found your suggestion interesting, but I am not aware of MySQL.

    If possible, I need your help, is there any way you can teach me how to do it, at least the syntax ??? ...
     
  6. troester

    troester Well-Known Member Staff Member

    Level: Community
  7. HyperOsmar

    HyperOsmar Member

    Level: Community
    troester, how are you ???

    I followed your suggestion regarding the use of databasejoin, but it is not working properly.

    Where am I my mistake ??? ...

    See attached images ...

    Respectfully,
     

    Attached Files:

  8. troester

    troester Well-Known Member Staff Member

    Level: Community
    It's not clear what in your screenshots are column names and what are table names.
    Fabrik has full element names (used in the placeholders) table___column (3! underscores, your screenshot looks like only 2)
    And it has to be placed into the "Joins where..." field, not into "Filter where"
     
  9. HyperOsmar

    HyperOsmar Member

    Level: Community
    OK...

    Table names (imagen databasejoin_003):
    • cad_municipios
    • cad_estagiarios
    I made the changes and the following message appeared (image databasejoin_004)
     

    Attached Files:

    Last edited: Apr 16, 2021
  10. lousyfool

    lousyfool Active Member

    Level: Community
    So, accordingly, please try using cad_municipios___uf_raw instead of your cad_municipios__uf_raw.
     
  11. troester

    troester Well-Known Member Staff Member

    Level: Community
    So beside the 3 underscores in the placeholder it doesn't know a column uf_est.

    Looking at databasejoin_where_001.jpg I assume it's cad_estagiarios_uf_est
     
  12. HyperOsmar

    HyperOsmar Member

    Level: Community
    troester,

    The correct is: WHERE '{cad_estagiario___uf_res}' = '{cad_municipios___uf_raw]'

    I had put the image wrong ...

    After adding the 03 underlines, the page opens normally, select the "State" but the "City" field is not loaded ...

    I sincerely apologize for taking your time...
     
  13. troester

    troester Well-Known Member Staff Member

    Level: Community
    No. If you want to use more than out of the box features of Fabrik you should learn a bit MySQL etc. It's
    WHERE some-db-table-column = 'something' (with Ajax update 'something' can be a Fabrik element placeholder {full-element-name})

    In my post above I didn't realize that you changed your WHERE condition form uf_est to uf_res

    In your screenshot databasejoin_where_001.jpg you don't have anything with uf_res.
    So please check your column names, element names etc., check your brackets (you have a ] instead of } at the end of your placeholder) ...

    Your table/columns names are still unclear.
    It may be
    WHERE uf_est = '{cad_municipios___uf_raw}'
     
  14. HyperOsmar

    HyperOsmar Member

    Level: Community
    troester, good morning ...

    Following your advice, I managed to change the CCD fields to DBJoin.

    With that, I was able to create a form template from an existing one.

    But I inform you that after creating a form from a template using a new table in the database, it is necessary to configure the DBJoin fields according to the elements of the new table.

    I really appreciate your help.

    Tks ...
     

Share This Page