0

How to action a trigger after form close?

Hi, am wondering how can i action the update trigger after i close the edit window? What is happening it  keeps on sending numerous notifications on every field i update which is cumbersome. I want to send only one notification after i am done will all my changes on a record.

let t := this;if Service != null and 'Assigned To' != null and Subject != null and Type != null and Department = null then    let staff_name := record(Staff,number(Requester)).'Full Name';    let ticket_type := record('Ticket Types',number(Type)).Name;    let receiver_address := record(Staff,number('Assigned To')).email;    let requester_address := record(Staff,number(Requester)).email;    sendEmail({        from: "supportdesk@company.com",        to: requester_address,        cc: receiver_address,        subject: "You you have an update on ticket number " + 'Ticket Number',        html: "Suport HelpDesk Notifications" + "" + "
" + "" + "" + "" + "" + "
Ticket Update Notification
" + "" + "
" + "" + "" + "" + "
" + "
" + "Hello " + "" + staff_name + "" + "," + "
" + "
" + "You have an update on your recent ticket. Track your ticket progress with the details below." + "
" + "
" + "Ticket Details" + "
" + "
" + "
" + "Ticket Number: " + "" + 'Ticket Number' + "" + "
" + "
" + "Ticket Status: " + "" + Status + "" + "
" + "
" + "Priority: " + "" + Priority + "" + "
" + "
" + "Ticket Type: " + "" + ticket_type + "" + "
" + "
" + "Ticket Solution: " + "" + Solution + "" + "
" + "
" + "Ticket Comment: " + "" + Comments + "" + "
" + "
" + "Ticket Url: " + "" + "" + urlOf(this) + "" + "
" + "
" + "
" + "
" + "Best Regards," + "
" + "
" + "Support HelpDesk" + "
" + "
" + "If you shouldn't be receiving this alert, please contact IT Support HelpDesk via Email: itsupport@company.com" + "" + "
" + "
" + "© " + year(today()) + " company - Powered by IT Team." + "
" + "
" + "" + "

My update script those codes above

4 replies

null
    • John_Halls
    • 2 yrs ago
    • Reported - view

    I'm not 100% sure but try this:

    If you don't have one on your form already, add a Tab. Place your code in the Trigger after hide option of the tab. If you only have one tab and don't want a second make it the first element of the table and it will replace the default tab.

    Although it says 'after hide' I am sure the field values are still available to the script.

    Let me know if it works.

    Regards John

      • MUGANJI_JULIUS
      • 2 yrs ago
      • Reported - view

      John Halls Hi, thanks for your suggestions however am wondering how will this trigger when data has been altered. the option sounds to be promising however, it will be triggered on every record regardless of no activity done on the record. Yet, as it closes, i assume data has been updated and it should fire.

      • John_Halls
      • 2 yrs ago
      • Reported - view

      MUGANJI JULIUS You are right. It will need additional controls to find out who and when the record was modified. There are 'Modified on' and 'Modified by' fields and you could use these in conjunction with the tab control Trigger before view

      These tab controls trigger as you move from tab to tab, so you will need to consider that if you have more than one tab in your form.

      Regards John

    • MUGANJI_JULIUS
    • 2 yrs ago
    • Reported - view

    Thanks John, let me try those options as advised.

Content aside

  • 2 yrs agoLast active
  • 4Replies
  • 183Views
  • 2 Following