How do I...?

Apps Script 'Event' Explanation

Can anyone explain or direct me to a link of the explanation of what the different 'Event' types indicate, and when you would use them?

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Kevin JonesKevin Jones shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • TrackViaAdminTrackVia (Admin, TrackVia) commented  ·   ·  Flag as inappropriate

        Hi Kevin -

        Good question.

        Unlike calculated fields, AppScripts don't run on page load. They must be triggered by an event in TrackVia.

        The six types of events that can trigger AppScripts are:

        -BEFORE INSERT
        -AFTER INSERT
        -BEFORE UPDATE
        -AFTER UPDATE
        -BEFORE DELETE
        -AFTER DELETE

        The Insert, Update, and Delete portions of these events correspond to an action in TrackVia. To choose the appropriate event, you'll need to determine whether you want your script to trigger on Record Creation, Record Edit, or Record Deletion, respectively.

        The Before and After portions refer to the order of operations and when the AppScript triggers. Meaning, should the AppScript trigger before the data is saved/deleted in TrackVia or after? In most cases, you'll want to use Before. A notable exception is with creating a new record and using AppScripts to add children. In that case, you'd use AFTER INSERT because the children need the parent to exist before they can link to it.

      Feedback and Knowledge Base