0

Trouble with affecting a text value in a new record

Hello,

With two linked tables I cant affect the value of a text field of the parent table into a text field in a new record of the child table with the command

atcd := Patients.lastatcd

in  "déclencher sur un nouvel enregistrement"

It works with a button with the same code. It works with a defined text chain...

atcd := "blabla"

Thanks for your help

Marc

4 replies

null
    • Birger_H
    • 4 yrs ago
    • Reported - view

    Can you give the complete code? Make sure the table relation is set when you try to set the value.

    Birger

    • Marc_Di_Francia
    • 4 yrs ago
    • Reported - view

    Hello Birger, The table relation is set ; the only line of code is

    atcd := Patients.lastatcd

    Thanks

    Marc

    • Marc_Di_Francia
    • 4 yrs ago
    • Reported - view

    So Birger,

    it seems that the procedure works in databases in teams/cloud, not in local databases opened with mac Appli...

    It is a little disturbing.

    Are there such known bugs in the mac appli ??

    Thank you

    marc

    • Mconneen
    • 4 yrs ago
    • Reported - view

    @Marc...  Hmm.. this is interesting.. 

    In another thread .. 

    https://ninoxdb.de/en/forum/technical-help-5ab8fe445fe2b42b7dd39ee7/does-ninox-support-web-forms-5b768acf03f12310870ad5a6?page=2

     

    I point out that the triggers fire out of order when running in pure cloud (not even mac app accessing a cloud database).  In the Mac app (regardless if it is a cloud hosted, local .. and not tested.. iCloud database)...  they fire as expected .. Create then Update.. 

     

    What is happening is that when Child's Trigger On Create fires.. the Child's reference to the Parent has not been updated.  It then updates and the Trigger on Update fires.    To prove this theory,  I created a "TriggerAudit" table .. and populate a record each time the Create or Trigger after Update fires from either the Parent or the Child table.. 

    trigger

    Here is the basic trigger logic

    triggerLogic

    Further... Once I had an idea of the trigger execution .. I updated the Child's Trigger on create like so.. 

    triggerCreate

    And as I expected... The Parent reference is null; 

    nullParent

Content aside

  • 4 yrs agoLast active
  • 4Replies
  • 1616Views