How to register a transfer order line with X++ AX 2012

Hi, I’m trying to register a transfer order line using X++ for a service method, the behavior would be the same as if you go to Transfer Orders > Inventory > Registration in AX, I found this tutorial:

domhk.blogspot.hk/…/ax2012-update-invent-registration-from.html

It seems like it works, however, the status on the InventTrans record is still “Ordered” and it should be “Registered”, is there any way that you could help me out?

Thanks in advanced, have a nice day.