When I look at the event checkout_onepage_controller_success_action and works, but I can not get the Id of the newly created order.
checkout_onepage_controller_success_action
Anyone have any idea
That event probably gets called before the action itself executes. Can you use sales_order_save_after instead?
sales_order_save_after
EDIT: Here's your ID code. In your observer:
public function setLinkStatus($observer) { $order = $observer->getEvent()->getOrder(); $id = $order->getId(); // do something useful }