web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

IsHandled flag and exit a return value

(0) ShareShare
ReportReport
Posted on by 215

Hello,

I'm wondering something. In the Codeunit 5790 "Available to Promise", in the procedure QtyAvailabletoPromise, which returns a Decimal value, there is a IsHandled flag. If I switch this flag to True, the procedure stops prematurely with an exit method. But this exit method doesn't return any value. Is there a way to return a value with an exit method after switching a IsHandled flag to True ? Or by any other way ?

Here is what I would like to have in the " If IsHandled then" : 

pastedimage1600933830413v1.png

Any idea on how to return a value after switching the IsHandled flag to true ?

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    The IsHandled flag is intended if you want to overwrite the standard code with your own code.

    You will need to create an event subscription to OnBeforeQtyAvailableToPromise.

    Do your own logic to calculate AvailableToPromise and then set the IsHandled flag to true.

    This way your calculation will not get overwritten by the standard logic.

  • Magicrevette Profile Picture
    215 on at

    Thank you for your answer.

    I know what you mean. The problem is, when IsHandled is set to True, the exit méthod doesn't return any value. So even if I've calculated AvailableToPromise  with my own logic, the procedure QtyAvailableToPromise won't return anything.

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    I just realized what you are trying to say.

    You are right. It doesn't make sense. It should return the QtyAvailableToPromise.

    You can report it as bug and hope Microsoft fix it on the next update.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 740 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 531 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 310 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans