How can I add a new sales line to an existing picking route using x++?

Hello, I’m working in AX 2012, normally when you create a SalesLine and pick it, it creates a picking route, and if you create a new SalesLine and perform the same process, it creates a new picking route as well, I need to add that new SalesLine into the existing picking route using x++, is there any way that I can accomplish that? I have seen that in the method SalesPickingListJournalCreate.createWMSJournal the new WMSShipment and WMSPickingroute are created, but at that point, there’s already in the buffer a record in WMSOrderTrans with the new pickingRoute, I have not identified in which class that wmsOrderTrans is created, to tell it to use the existing route instead of create a new one.

Thanks in advanced for your help!

According to cross-references, WMSOrderTrans records are created by WMSTransport::createTransportLine() (which is called from several places). If you don’t want to a static analysis with cross-references, simply put a breakpoint to WMSOrderTrans.insert() and run the process you’re interested in.