Help with Event is not getting created!

gemini17
Kilo Guru

I created the business rule in the developer program, training.   I lost the original Marketing Event application, so I had to start all over and created a similar M_Events application.

My script for the business rule is:

function onAfter(current, previous) {

  //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_19025_m_events_a_attendee.added', current,

  current.marketing_event, current.email);

  }

  //Add event when marketing event changes

  if(current.operation() == 'update' && current.marketing_event.changes()) {

  gs.eventQueue('x_19025_m_events_a_attendee.deleted', previous,

  previous.marketing_event, previous.email);

  gs.eventQueue('x_19025_m_events_a_attendee.added', current,

  current.marketing_event, current.email);

  }

  //Add event when attendee deleted

  if(current.operation() == 'delete') {

  gs.eventQueue('x_19025_m_events_a_attendee.deleted', current,

  current.marketing_event, current.email);

  }

}

when I try to add attendees< I get error:

Access to event 'x_19025_m_events_a_attendee.added' from scope 'M_Events_Application' has been refused. The event is not defined.

Any help is appreciated.

Kind regards

Danny Raj

15 REPLIES 15

Michael Fry1
Kilo Patron

On your newly created table, under Application Access, did you check Can create, Can update, Can delete so Global scope can access it?


I enabled, I checked, 'Can Create', 'Can Update', and 'Can Delete'. Stil, I get the same error, 'The event is not defined'.   Any suggestions, as to what I am doing wrong.



Kind regards


Danny


Mike Allen
Mega Sage

Is the event registered in the Event Registry?



find_real_file.png


Hello Mike:


I did register the events.   The issue is, when I am testing event creation in the event log: I am not getting the same screen shot shown in the training module, which is:



app_store_learn_coding_app_store_dev_portal_learning_coding_images_TestEventLog.png


In my case when I check the event log, after using the filter created on today and name 'starts with' x_19025 which is the prefix for my application, I get blanks for Parm1 and Parm2 on the x_19025_m_events_a_attendee table.   When I tried to add or delete an attendee, I get the error, the event is not defined in the application!


Any suggestions, is appreciated.



Kind regards


Danny Raj