0

Load (Transfer) Data

There are any way to Load (transfer) data for one table, to a  Reference 1:N on other table, with a Button.

19 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    You can duplicate the table.

    You can create a link between the two tables and just reference the records you need.

    You can create a button that creates the new records and copies the data.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred Hi Fred.

      do as server
              let xPry := first(select 'Control Issues');
              let xFld0 := xPry.Date;
              let xFld1 := xPry.Week;
              let xFld2 := xPry.Document;
              let xFld3 := xPry.'Rev A';
              let xFld4 := xPry.'Rev B';
              let xFld5 := xPry.'Rev 0';
              let Pgr := (create 'Issues Week').'Control Issues_');
              Pgr.(Date := xFld0);
              Pgr.(Week := xFld1);
              Pgr.(Document := xFld2);
              Pgr.('Rev A' := xFld3);
              Pgr.('Rev B' := xFld4);
              Pgr.('Rev 0' := xFld5)
          end

      I try this on button but don't work.

      The 1st Table 'Control Issues' have the data that I need to copy to table the 2do 'Issues Week inside are ' on a reference  1N Issues Week_ to 'Control Issues'.

    • John_Halls
    • 1 yr ago
    • Reported - view

    Hi Rafael

    You are doing everything right, but you are not creating the link, Try something like this

    do as server
            let xPry := first(select 'Control Issues');
            let xFld0 := xPry.Date;
            let xFld1 := xPry.Week;
            let xFld2 := xPry.Document;
            let xFld3 := xPry.'Rev A';
            let xFld4 := xPry.'Rev B';
            let xFld5 := xPry.'Rev 0';
            let Pgr := (create 'Issues Week');        <-- No need for 'Control Issues_' here
            Pgr.('Control Issues_' := xPry);          <--- This line creates the link
            Pgr.(Date := xFld0);
            Pgr.(Week := xFld1);
            Pgr.(Document := xFld2);
            Pgr.('Rev A' := xFld3);
            Pgr.('Rev B' := xFld4);
            Pgr.('Rev 0' := xFld5)
        end
    

    Regards John

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      John Halls Hi John thanks a lot, I'll try it later.

      Appreciate. 👍

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      John Halls hi John

      Give me a error message 

    • John_Halls
    • 1 yr ago
    • Reported - view

    Hi Rafael

    Can you post screen shots of the field structure of the two tables. I want to see what the relationship is between the two.

    Thanks John

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      John Halls Hi again John, Need to Load the info on 'Control Issues' Table on 'Issues Week' Table on Reference 1:N 'Control. Issues_ 

    • Fred
    • 1 yr ago
    • Reported - view
    Rafael said:
    Need to Load the info on 'Control Issues' Table on 'Issues Week' Table on Reference 1:N 'Control. Issues_ 

     You should have a field in each of the Control Issues records called Issues Week, or whatever you call. Since you are creating the link after you have created the sub-records, what field in Control Issues can you use to match in Issues Week?

    The image of Issues Week only have 1 record. Will you have more? or will all records in Control Issues link to this one record in Issues Week?

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred John Halls

      I send the DB,, better if you view the idea.

    • Rafael Sanchis
    • Rafael_Sanchis
    • 1 yr ago
    • Reported - view

    Fred John Halls

    Other example. Maybe more clear I suppose 😔

    Table 'Progres Cost Report' This table is generated with a Script every Friday, (With a Button the data is eliminated and it is generated again with the data of the new week).

    I have another table 'Print Progress' link to 'Progress Cost Report' 1:N the name of reference is 'Progress Report to Print'.  The problem is where every Friday I generate the report 'Progress Cost Report'  the data on 'Progress Cost Report' lost in the info on 'Print Progress' and should somehow update this table. The idea is Load again the data with a Button the field are the same in both tables.

    The idea is to Print the 3 reports

    I hope understand the idea. 

      • Fred
      • 1 yr ago
      • Reported - view

      Rafael The DB you upload does not have all of the tables you reference in this Post Reply.

      Back to your original post you say there is a 1 (Issues Week) to N (Control Issues) link, so all you need to do is set the field 'Issues Week' in Control Issues to the appropriate record Id. In the current setup of your Issues Week table there is only 1 record with an Id of 2.

      You can do this with a button or with the Bulk Edit command.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred ok Fred I try to do that.

      Thanks

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred Hi Fred 😞Sorry I've given this so much thought that I don't see it.

      I send I Right DB if you can help me appreciate. This DB have the both tables.

      One year now with Ninox and don't learn to much 😟, and with the most complicated language yet. 

      Appreciate your help

    • Fred
    • 1 yr ago
    • Reported - view
    Rafael said:
    I've given this so much thought that I don't see it.

     Open a record in 'Control Issues', you will see the filed 'Issues Week'. It is empty. Click on it and select the only record available. You have now created the link.

    Now go to Issues Week and open the only record. You will see that record in Control Issues is now linked to the only record in Issues Week.

    Is that what you want?

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred Thanks Fred. 

      In the end I solved it via Bulk Edit. I image that is no possible to sequence the Bulk Edit in a Script to ad on a button

    • Fred
    • 1 yr ago
    • Reported - view
    Rafael said:
    In the end I solved it via Bulk Edit. I image that is no possible to sequence the Bulk Edit in a Script to ad on a button

    This solution is for after the records in Control Issues have been created.

    I don't know what you have planned for the future. Is Issues Week a dashboard or will you be creating new records that are linked to records in Control Issues.

    If Issues Week is a dashboard then all you need to do is add the following to the Trigger on new record for Control Issues:

    'Issues Week' := 2

    If you plan on creating new records in Issues Week then:

    1) if new records in Control Issues are scripted then you need to change the script that creates the Control Issues records and add a part that creates the Issues Week record first then links to the Control Issues records that are created.

    2) if you manually create records in Control Issues, then the easiest way would be to start in Issues Week, create that record then through the new Issues Week record create the Control Issues records.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred Hi Fred

      Yes The Table Issue Week need to be generated with the linked records in Control Issues.

      The Control Issue is generated  by a button on wbs Documents/Transmital 

      What I do,  When I CutOff every Friday, there are new documents issues A/B/0, when Finish the update all documents,

      1- On wbs Documents/Transmital  with the button Delete all Issues  delete  all records on Control Issue table.

      2- Then with the other button Create All Transmital generate again the info on 'Control Issue' with the all Documents. 

      3- When the Control Issue Table is update, need the Issue Week update too.

      The only reference is 1:N Issue Week to Control Issue.

    • Fred
    • 1 yr ago
    • Reported - view
    Rafael said:
    2- Then with the other button Create All Transmital generate again the info on 'Control Issue' with the all Documents. 
    3- When the Control Issue Table is update, need the Issue Week update too.

    Just to clarify, you don't plan on deleting the one record in Issue Week? If you don't plan on deleting the record, then do the option I suggested about the Trigger upon new Record. So whenever you create a new record in Control Issues they automatically get linked to the 1 record in Issues Week.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred No on Issue Week don't need to delete Records.

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 19Replies
  • 158Views
  • 3 Following