When I'm using the send to freight system button the freight tab.
It ends up in code like this.
Dim salesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm = DirectCast(button.FindForm, JiwaSalesUI.SalesOrder.SalesOrderEntryForm)
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(salesOrderForm.SalesOrder , JiwaSales.SalesOrder.SalesOrder)
Dim SalesOrderH As JiwaSales.SalesOrder.SalesOrderHistory = salesOrder.SalesOrderHistorys(salesorder.CurrentHistoryNo)
We found cases where we are on D03, but want to send D02 to the freight company.
The above code selected the latest history, so just continues to resend D03.
How do I change the above code so the salesorderH, pick up the current displayed D02, rather than the last current history D03. Can I get it from the form somewhere?
e.g. Picture below Shows D03, when I'm looking at D02.