Classical one, that I have seen over the years, growing up with the ERP (though I could be wrong), but please allow me to say what I think on this.
I reckon you are talking about one of those classic quirks in Dynamics AX (or Axapta, as some of us still call it), where the system doesn’t always show you everything until after you’ve posted it.
A good example I remember from back in the days, when I was young, is how sales tax is calculated on a Sales Invoice. The code you need to calculate the tax before posting is different from what you’d use after posting. And there’s actually a good reason for that.
I will give you a good example, here:
If the Sales Invoice hasn’t been posted yet:
Use Method A to calculate tax
If it has been posted:
Then you’ve got to use Method B
The thing is, a sales order is really just a statement of intent. Not a proper financial commitment. So, even if the order says 15 units, there’s nothing stopping the customer from changing their mind and only going for 10 in the end.
You can have an order or quantity 50 but with 4 invoices of 10 quantity each (total sales 40, not 50)
That’s why the system behaves differently before and after posting. Because nothing's final until it’s posted.
You may want to use CredManCreditControl_SalesFormLetter::newFromDocumentStatusCheck because of the reasons I have mentioned)
As André said, if you can share a few screenshots, we’ll happily take a look, to try to help.
Thank you!