• Resolved recepbala

    (@recepbala)


    i could not figure out how to do this with WPDataAccess ??

    3 tables -> customers, services, services_providers
    1 table -> to bind them all when a service is sold

    while looking at customers table, i should be able to sell a service from a service provider. it would be nice to even filter service providers by the chosen service ??

    hope i dont need premium for this ??

    • This topic was modified 2 years ago by recepbala.
    • This topic was modified 2 years ago by recepbala.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @recepbala,

    Can you give us more details about what you want to achieve?

    Is this a front-end table display or a full-blown data project? ??

    We look forward to your response.

    Thread Starter recepbala

    (@recepbala)

    we may say data project for a small company ??
    tring to keep track of things going on in the company

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @recepbala,

    What do you mean with:
    3 tables -> customers, services, services_providers
    1 table -> to bind them all when a service is sold

    Is this a view joining the other tables? Or a master detail page? Or something else?

    If you want to join multiple tables, you can just create a view from your custom query and use that view instead of a table in your project or publication. Master detail pages can be created with Data Projects where each detail table can be show in a seperate tab. Here is the documentation:
    https://wpdataaccess.com/docs/data-projects/one-to-many-relationships/

    A premium license is not needed for these features, but adding dynamic filters might. It depends on your requirements. Is this a reporting page or data management? In other words: is the user changing data or only viewing?

    Thanks,
    Peter

    Thread Starter recepbala

    (@recepbala)

    all start with customer table.
    and i got another table showing what is/are serviced to each customers.
    parent/child working perfectly.

    the thing is that this child table got another relations also.
    when i add a record, i need service_name from another table related through service_id. i need service_provider_name from another table related through service_provider_id.

    if it was parent table, i figure things out but it is child table

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @recepbala,

    Data Projects supports parent-child relationships only. Parent-child-grantchild is not supported (not yet). For the child-grantchild relationship you need to use a dynamic hyperlink.

    That hyperlink needs to redirect the user to a second project showing the child-grantchild relationship. You can get the url to that project by executing it. On the front-end you’ll need to jump to another page. On the back-end you just need to change the page argument.

    But this just brings the user to the list table of the child table, which is now the parent table (hope I’m clear…?). To directly jump to the data entry form (which I presume is what you want) you need to add two arguments:
    action=edit
    pk_key=pk_value

    Where pk_key represents the column name of the primary key and pk_value represents the primary key value. If your primary key consist of multiple column, you need to add each column name and value. The plugin will automatically pick up these values.

    This is the more advanced stuff! ?? Let us know if you get stuck.

    Have a nice weekend,
    Peter

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Database Relations’ is closed to new replies.