RE: The record is not open
Hey ERPMAN!
I will give my answer as a teaching answer for programmers (since it cannot be solved from our side) and to know the reason you must have some code visibility.
The error is telling u that the var RecRef that the codeunit 1173 want to use isn't open.
For programmers this line is giving the error:
ToFieldRef := ToRecRef.Field(3);
In this example, it means that "ToRecRef" has not a table.
So Why is the var without table reference?
Going a little back in the codeunit process, we reach procedure DocAttachForPostedSalesDocs() - Codeunit 1173
And we reach this code:
if SalesInvoiceHeader."No." <> '' then
ToRecRef.GetTable(SalesInvoiceHeader);
if SalesCrMemoHeader."No." <> '' then
ToRecRef.GetTable(SalesCrMemoHeader);
Seems to me that the reason is that the HistoricHeader has no "No." when is automatically post.
That's the reason of the error.
Now why it's happening must have to be with a personalizated code, because in the post, the "No." should be filled properlly.
For an extra input:
With the new versions of BC (21.5 & 22.0), we detected on some of our company products that some events in codeunits 80 and 90 has stopped to work, this 2 codeunits are too much used, and for me, its a fault of Microsoft that didn't implemented interfaces behaviour correctly.
If an event stop to work, they must give an error, but since the event is not market as obsolete u need to know from an error that it's not working...
The reason the events are not marked is because teorically they will launch from the interface, but its not working from the interface but from the codeunit, so currently it's a dangerous error.
Maybe u have an error in some personalization that tries to reach this events and are never launched, so before it was working and now u just have a part of the code working (deleting the No., but never filling it again)