Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.

Create an event

Log in to subscribe to topics and get notified when content changes.

Create an event

If you do not find a suitable existing event, you can create your own.

Before you begin

Role required: admin

About this task

The gs.EventQueue function works directly with the backend and therefore business rules that are called by gs.EventQueue() are not invoked.


  1. Navigate to System Policy > Events > Registry.
  2. Click New and fill in the form.
  3. Click the Business Rules related link.
  4. If you are creating an event for a base system table, select the existing event business rule for the table.
    For example, select the sc request events business rule to create a custom Request event.
  5. If you are updating an existing event business rule, add a new condition to the Script.
    The following sample script adds a request.commented event with the user's Sys ID as parm1 and the user's user name for parm2.
    if (current.operation() != 'insert' && current.comments.changes()) {
    gs.eventQueue('request.commented', current, gs.getUserID(), gs.getUserName());
  6. If you are creating an event for a custom table, create a new business rule that runs after database operations.
    For example, this business rule defines several events for a custom application called Marketing Events.
    Table 1. Sample event business rule
    Field Value
    Name Attendee Events
    Table Attendee [x_snc_marketing_ev_attendee]
    Application Marketing Events
    Advanced Selected
    When after
    Insert Selected
    Update Selected
    Delete Selected
    Add custom script that:
    • Checks for one or more conditions on the current record.
    • Calls the gs.eventQueue() method and specifies an event name.

    See code sample.

    Note: If you add Filter Conditions, Role conditions, or a Condition value, verify it runs the business rule when expected.
    (function executeRule(current, previous /*null when async*/) {
       //This function will be automatically called when this rule is processed.
            //Add event when attendee inserted
            if(current.operation() == 'insert' && current.marketing_event.changes()) {
                    gs.eventQueue('x_snc_marketing_ev.attendee.added', current,
            //Add event when marketing event changes
            if(current.operation() == 'update' && current.marketing_event.changes()) {
                    gs.eventQueue('x_snc_marketing_ev.attendee.deleted', previous,
                    gs.eventQueue('x_snc_marketing_ev.attendee.added', current,
            //Add event when attendee deleted
            if(current.operation() == 'delete') {
                    gs.eventQueue('x_snc_marketing_ev.attendee.deleted', current,
    })(current, previous);
  7. Register the event.

What to do next

Create a script action or notification to process the event.