0

Trigger on Open....

Is there any way to trigger actions on open a record? (there are on create and on update)

Background: I am implementing a "cancel / undo" option where I want to rollback the values in case of undo/cancel....

I am basically creating a duplicate record with a "backup" but I was looking forward to having a more elegant option....

 

thoughts?

cheers

Luis

36 replies

null
    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    RoSoft_Steven This is a good idea, as I have longed since wanted an event to trigger on OpenForm or CloseForm (without having to update something)

    Your idea works on all tabs after the main page on the form. However this replies on triggering that tab. Ideally I want it on the main first page, which of course by default the tab shown is the form name itself and you can't append a trigger before view on ... aha I though - I know I will create a tab and drag it all the way to the top of the edit list and append the trigger to that tab.

    Great I can add the simple script (DisplayMenu := 1)  Nope it don't work (unless I exit the db and then go back in)

    Only works on 2nd tab and after 😢

      • Ninox partner
      • RoSoft_Steven.1
      • 2 yrs ago
      • Reported - view

      Mel Charles 

      Strange, this must be a bug... Does it continue to work after you reopened your database in the first tab or do you have to reopen every time?

      Image above is to do what MEL describes (creating a first own TAB element)

      Steven

    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    re first tab - Found it also works if you go into the form then close it then go back in... but not in all cases - weird !

    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    RoSoft_Steven No mate- on the first tab it won't trigger unless as stated you go in firm (not worked

    exit then go in again (works) same for every record

    also tried to ur script on global - but its not having it (probably trying to do it wrong tho...)

    see sample (set it to alter MODdate cell to today)

    so open form (nothing)

    close the form\

    then reopen

    Hey presto (works)

    No form update taken place! other than the trigger to set today in ModDate

    as you can see I added a tab to replace the main form name

    Form is called JobDockets by default (new tab Main)

    so close but .......

    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    I've emailed support to see what they say on this having to go into the form twice before it will trigger

      • Ninox partner
      • RoSoft_Steven.1
      • 2 yrs ago
      • Reported - view

      Mel Charles thanks Mel 👍

    • Fred
    • 5 days ago
    • Reported - view
     said:
    it is supposed to be hidden, as it only works as a container for the attachment I send in an email

    If a person can have many licenses then maybe create a child table called images or attachments then create a new record for each license. Now you have a record for each license the person has and can access any of them whenever you want.

      • Leo_Woer
      • 5 days ago
      • Reported - view

       I have talked with my customer and that triggered him away from the earlier wish. So he is quite clear to have this setup with a parent/child relationship. I will Start working on this tomorrow and will probably come back to you if I run in to problems - I will anyway give you a status.

      Thanks a lot

      Leo

      • Leo_Woer
      • 4 days ago
      • Reported - view

       Hi Fred

      I have created a child table called "Sendte Licenskort" with two fields : Membernumber and an Imagefield called Licenskort.

      However when I from the button says :

      let i:=create childtable

      i.(Licenskort := importFile(this, printAndSaveRecord(this, myFilename), "Licenskort.pdf"))

      It cannot find the layout I have in "myFilename"

      I am sure that it is because I haven't properly linked the parent and the child correctly and the layout is in the parent table.

      Can you help here - also so I can create many Children with different content in the imagefile

      Thanks a lot

       

      Leo

      • Leo_Woer
      • 3 days ago
      • Reported - view

       Hi Fred - every thing is working now. Thank you very much for your input, which have been invaluable.

      during my searching I fell over that you have created an html table which you placed in the forum, for people to get inspired. I have downloade version 2 an will look into this also.

      regards

      Leo

      ps. I will mark this as answered

      • Fred
      • 2 days ago
      • Reported - view

      If you really want to be inspired, look at   great Dashboard Template.