0

Button to Send Message and Create Entry in Log

Hi, can someone help please.  I'm almost there.

I have this Tab

 So when I click on 'Join Reminder' button it creates a Text message for sending and this works perfectly.  I then want an entry automatically in the log.  So here is my code and the log is created but not linked back to this Member.  

let t := this;
(create 'Support Log').(
    'Support Type' := "Join Reminder";
    Date := today()
)

I was sure the 'this' command would have done it.  I need to know where to put 't' as the 'Groups' below isn't a field I created, but obviously the link between the two tables. 

Other table is like this. I know a reference should go into 'Groups' to make it link, how do I achieve this please?

 

3 replies

null
    • Fred
    • 3 mths ago
    • Reported - view
     said:
    I was sure the 'this' command would have done it.  I need to know where to put 't' as the 'Groups' below isn't a field I created, but obviously the link between the two tables.

    The 'this' command only gets the rid (record id) of the current record you are on. You can then reference the variable and get access to all of the data of the record.

    If the reference field Groups points to the same table in your first picture (this is where it would be handy to know table names), then all you need to do is:

    let t := this;
    (create 'Support Log').(
        'Support Type' := "Join Reminder";
        Date := today();
        Groups := t
    )
    
      • adrianlavery
      • 3 mths ago
      • Reported - view

       Wow, that simple.  Thank you so much, that makes my DB so much better, by miles.  Thank you.

      • Fred
      • 3 mths ago
      • Reported - view

      If everything works, please mark the post answered when you get a chance.

Content aside

  • Status Answered
  • 3 mths agoLast active
  • 3Replies
  • 46Views
  • 2 Following