PATCH() across multiple tables & maintain referential integrity

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 11

  • @wendymeyer1250
    @wendymeyer1250 6 місяців тому +1

    Very nice. Thank you for explaining this all so clearly

  • @ronbakker1300
    @ronbakker1300 6 місяців тому

    Thanks David, definitely going to need this sooner or later. I really like these shorter videos that don't cook my brain.

  • @jasonmelchert155
    @jasonmelchert155 7 місяців тому

    This is so helpful. I was using varRecord for an item selected from a gallery and then using that variable as the source in another gallery to edit the fields of the record. My problem was that varRecord didn’t update with any changes so after every patch I had to use Set to update var Record again so those changes could be reflected in other controls, notifications, etc. Your wrapping method appears to be much more efficient. Thank you! Is there any risk in your example that the ID of the new record wouldn’t be created and returned fast enough to use that ID in an email notification from your save control?

    • @DavidSoden
      @DavidSoden  7 місяців тому

      Thanks. There is always the possibility that something can go wrong. Not likely as it's sequential but it is a platform. Consider adding ua-cam.com/video/iKtNb9UWS-k/v-deo.html

  • @Skaffapiraatje
    @Skaffapiraatje 11 місяців тому +1

    How would you write multiple input fields to table 1 (e.g. first name, last name) and then multiple input fields to table 2 (e.g. email and phone number). But then also multiple fields to a tabel 3 (e.g. company) that is only connected with table two through a foreign key? We would need to save multiple ID's while patching. How does that work?

    • @DavidSoden
      @DavidSoden  11 місяців тому +3

      When you make a normal patch patch statement wrie fields you need - but - simply do it inside a SET variable function to capture the result or the return info resulting from the PATCH. This variable will hold record including the Primary Key resulting from that patch if DEFAULTS was used in that patch. Use this variable name and the dot notation to get to the primaryKey. If my Table was named FOO and my variable was MyVar it would look something like MyVar.Foo. With that you can then use it in the next patch to assign/write a foreign key value or use the entire record if the data source is looking for that. You can then use this technique again and again for multiple repeated/related tables. you just need to know the hierarchical flow in which table needs to go first then second, third and so on.

  • @Amit4u4365day
    @Amit4u4365day 7 місяців тому

    Great Work 👍

  • @michelrail
    @michelrail 7 місяців тому

    Bad blurry video and no sound

    • @DavidSoden
      @DavidSoden  7 місяців тому

      I just checked and it seems to have loaded fine with sound on my phone. Perhaps it's your internet browser or UA-cam's having a problem? Anyway, I'm sorry you're having a problem. I can't see anything that I can do on my end to fix it.