Hi,
I'm struggling to get the Cash flow forecast to run within any decent time. I'm running it in batch, and it takes a very long time (>1 day) and ends up locking the LedgerCov table.
I've been looking in the code to see what the job does (LedgerCovTotal), and I have also seen that most of my time is spent updating sales orders.
The documentation here: https://docs.microsoft.com/en-us/dynamics365/unified-operations/financials/cash-bank-management/cash-flow-forecasting
says that "Sales orders that aren't yet invoiced, and that result in physical or financial sales." are considered.
However, SalesTableType.updateLedgerCov() calls SalesTableType.mustCovBePlanned() to see if a given sales order should be processed. And mustCovBePlanned() returns true for all sales orders which have SalesStatus = Invoiced (I'm on Ax2009).
To me that looks like all historical sales orders, which are invoiced, are being processed every time the cash flow forecast is run (for Total). Since the processing of a sales order includes calculating totals and all types of amounts on the order, I'm beginnign to see where my time is getting lost.
So returning to the statement in the documentation that sales orders which aren't invoiced are considered, I'm confused as to if those invoice sales orders are supposed to be processed or not? I realize the documentation link is for D365, so is it a possibility that this has changed since Ax2009?