The crux of this is a solution to calling Erp.SalesOrderSvc.SetReadyToCalc from a custom code function not working.
A bit of background: I have been attempting to write a very basic integration to allow us to continue transaction and taking orders while kinetic is down, both for backup in the event of an issue, and for use during kinetic updates.
In doing so I have been looking for a way to bring in a new Sales Order programmatically via a REST Api call to a custom function. I decided on this approach as it keeps all the logic for building the kinetic entities within kinetic. I had initially played with the idea of having the logic in the console application which is fetching data and pushing it to kinetic, but decided bringing the logic outside of kinetic was adding extra complexity for no reason.
So I created a function in kinetic which takes in a JSON encoded string containing all the pertinent data to create the sales order, order lines, and releases. The function then calls the various functions required to set everything up onto the OrderHed dataset.
However, the method SetReadyToCalc did not seem to work. This method is called when you click on calculate taxes in the OrdersEntry but when called by the code it doesn’t do anything. There are a few references to this on here, but none of those answers working in my exact scenario (New sales order on Kinetic 2024.1) So I thought I would share what did work for anyone else who is finding the same issue.