Skip to main content

Notifications

Community site session details

Community site session details

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

The C/AL functions listed below are available during write transactions...

(0) ShareShare
ReportReport
Posted on by 30

Hello guys,

I have noticed a strange behaviour today when posting sales orders.

I was posting as usual and suddenly this message came up:

Fehler2.PNG



Then I confirmed the message with Yes and posted again and then the message did not come up anymore. The sales order was posted.

Now I have posted more sales orders and every now and then the message came up again.

Now I turned on the debugger and waited for the error to come up again and lo and behold, it has a problem with calling up the page from time to time. But I don't understand why it sometimes has a problem and sometimes not.

Fehler1.PNG



The page that usually opens immediately is only there for me to enter the posting date and the document date.


Do you have any idea how I could fix this?

Thank you very much.

  • Suggested answer
    YUN ZHU Profile Picture
    83,147 Super User 2025 Season 1 on at
    RE: The C/AL functions listed below are available during write transactions...

    Hi, From the error message, it looks like a table is locked. So Nitin's suggestion of adding the Commit method is a bit risky, but it does seem to be a solution.

    I think you need to test it in more detail. If you encounter an order that has gone wrong, you can use the Copy Document method to copy the posted Invoice and retest it. See if the value of a field is causing this.

    Hope this helps as well.

    Thanks.

    ZHU

  • Maddin Profile Picture
    30 on at
    RE: The C/AL functions listed below are available during write transactions...

    Hello,

    thank you very much for your suggested solution.

    We have now implemented this in our test system, but find it difficult to import this change into our real system. The background is that we suspect that we might get some inconsistent data after posting if there is an error.

    If an error occurs during the transaction, there is no rollback for the transaction. Any changes made by the transaction are therefore preserved...do you have any idea how we could avoid the commit but still work around the error we get?

  • Suggested answer
    Nitin Verma Profile Picture
    21,548 Moderator on at
    RE: The C/AL functions listed below are available during write transactions...

    Hi,

    Seems that its your custom code, please put a COMMIT function after Clear function you used.

    pastedimage1659082076745v1.png

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 944

#2
YUN ZHU Profile Picture

YUN ZHU 848 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 602

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans