Hi BC Gurus,
I seem to have an issue when manually trying to ship a sales order.
I receive this error when the Sales Order is status "Open" and we try to ship.
It looks like a Microsoft Base Application is triggered causing the error.
"Document Attachment Mgmt"(CodeUnit 1173).CopyAttachmentsForPostedDocsLines line 18 - Base Application by Microsoft
"Document Attachment Mgmt"(CodeUnit 1173).CopyAttachmentsForPostedDocs line 43 - Base Application by Microsoft
"Document Attachment Mgmt"(CodeUnit 1173).DocAttachForPostedSalesDocs line 29 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).OnBeforeDeleteAfterPosting(Event) line 2 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).DeleteAfterPosting line 9 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).FinalizePosting line 77 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).OnRun(Trigger) line 171 - Base Application by Microsoft
"Sales-Post (Yes/No)"(CodeUnit 81).RunSalesPost line 12 - Base Application by Microsoft
"Sales-Post (Yes/No)"(CodeUnit 81).Code line 25 - Base Application by Microsoft
"Sales-Post (Yes/No)"(CodeUnit 81).OnRun(Trigger) line 10 - Base Application by Microsoft
"Sales Header"(Table 36).SendToPosting line 12 - Base Application by Microsoft
"Sales Order"(Page 42).PostSalesOrder line 10 - Base Application by Microsoft
"Sales Order"(Page 42)."Post - OnAction"(Trigger) line 2 - Base Application by Microsoft
Is there any reason why we get this error when everything seems to be fine?
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)
Hi,
Its seems that you have some customization in the system, because i just checked in standard system its working fine.
Thanks.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156