Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

The record is not open

Posted on by 60

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.

pastedimage1682061505769v1.png

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? 

  • MetaKa Profile Picture
    MetaKa on at
    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)

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: The record is not open

    Hi,

    Its seems that you have some customization in the system, because i just checked in standard system its working fine.

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans