Hi To All!
Can someone help me on how to not use the autogenerated event_id? I’ have a method that generates id across my app which I’d like to use globally.
Many thanks
Hi To All!
Can someone help me on how to not use the autogenerated event_id? I’ have a method that generates id across my app which I’d like to use globally.
Many thanks
Update, the following worked,
function custom_insert_event_id($action){
$action->add_field("event_id", Utilities::generateIdx(TRUE));
}
$scheduler->event->attach("beforeInsert", "custom_insert_event_id");
… but the following isn’t returning the right tid
dp.attachEvent("onAfterUpdate", function(sid, action, tid, tag){
if (action == 'updated' || action == 'inserted')
{
actions(tid);
}
});
Try to use
function custom_insert_event_id($action){
global $new_id;
$new_id = Utilities::generateIdx(TRUE);
$action->add_field("event_id", $new_id);
}
function custom_insert_event_id_after($action){
global $new_id;
$action->success($new_id);
}
$scheduler->event->attach("beforeInsert", "custom_insert_event_id");
$scheduler->event->attach("afterInsert", "custom_insert_event_id_after");
Wow! Apparently your solution works, thank you so much …
Cheers!
willowdan