0

Formula for the button

Good evening everyone and Merry Christmas
I need professional help. I'm having trouble describing the problem, so I'm attaching the database so you can examine it in more detail.

There is an investors tab in the PROJECT table. The task is that the data entered there should be transferred to the investors table, to the corresponding fields and table, so that it would be possible to view who invested how much and in which project

Thank you all in advance
Merry Christmas

9 replies

null
    • Fred
    • 4 days ago
    • Reported - view

    Looking at your DB the Investors tab in the PROJECT table is empty except for a reference field. You will have to be more specific about what you are looking for.

    Can you upload another DB with the fields you want to copy?

    How are you planning of selecting investors? Can you create new investors or only pick from Investors table?

      • John_Halls
      • 3 days ago
      • Reported - view

       Glad you asked, I was struggling to get my head round this one...

    • Fred
    • 3 days ago
    • Reported - view

    Looking back at your past post you have asked similar posts. I would ask that you try to write the code first and post it. No better way to learn then to do it.

    I understand that the end goal seems huge and daunting. May I suggest that you take it one step at a time. Maybe just start with how you will select an investor(s) and create the records and proper linkage. Then add the next step and so on.

    We can help you along the way, but I think you should write the rough drafts.

      • iliper LTD
      • iliper_LTD
      • 3 days ago
      • Reported - view

       good morning
       I tried to do this using the experience of other databases, but I couldn’t do it, so I ask for help here
      In the Project table, there's an Investors tab, which contains the Projects investor table. When we open it, there's a dynamic selection field called Name, where we select an investor. Then, in the Investment table, we enter the Sum, date, and comment.
      The button should save this entry, and also in the investors table, find this investor and go to his account in the  Tab, in the investments in projects table, record the information in the corresponding fields
      "How are you planning of selecting investors? Can you create new investors or only pick from Investors table?" - First, we create an investor in the table for investors, only after that we can make him an investor in projects.

    • John_Halls
    • 3 days ago
    • Reported - view

    If you look at your data model, it looks like this

    There is nothing joining your Investors to your Projects. Because a Project can have more than one Investor, and an Investor can invest in more than one Project you need an additional table, called a join table, that creates this Many-to-Many relationship.

    Once you have this in place it might become more obvious how to do what you want.

    Extra hint... I don't think you will need a button!

    Regards John

      • iliper LTD
      • iliper_LTD
      • 3 days ago
      • Reported - view

       Thank you for taking my request into consideration. I'm not a programmer, so I can probably do some basic work. I read about creating relationships between tables, but I couldn't figure it out. If you can do this, I'd be grateful. There's a database there, and you can attach a completed response to the message.

      • Fred
      • 3 days ago
      • Reported - view

        

      I read about creating relationships between tables, but I couldn't figure it out.

      Your Invesments table is another possibility to use as the JOIN table between PROJECTS and Investors. Instead of a dC field you can add a relationship field to Investors, now the Invesments table is your M:M table.

      You can remove the Invesment in Projects table as you will have a new reference table under Investors that links you to the Projects through Invesments.

    • iliper LTD
    • iliper_LTD
    • yesterday
    • Reported - view

      Good morning
    I can't find a formula for the filter for view to show only those records that relate to this project.

    • Fred
    • yesterday
    • Reported - view

    It looks like you want to use Invesment in Project as your join table. To make that work the Invesment in Project table has to be the many (M) side of the relationship. 

    If you look at the field oldPROJECTS2, you will see that Invesment in Project is the 1 side:

    In Ninox, you want to be in the table that is on the many side to create the link. If you only see the ability to select one record then you are on the many side. If you see a table where you can add a record or create a new record then you are on the 1 side. Now each record in Invesment in Project is linked to 1 record in Investors and 1 record in PROJECTS.

    Since we created the new reference field in Invesment in Project, we also now have a new relationship field in the PROJECTS table, also called Invesment in Project (you can rename it to whatever you like). If you click on the Chili record, and go to the Investors tab, you will now see the one investor. I renamed the View to oldView as you no longer need it anymore.

Content aside

  • yesterdayLast active
  • 9Replies
  • 45Views
  • 3 Following