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 :
Business Central forum

If inside modify

(0) ShareShare
ReportReport
Posted on by 5

Can we use if inside modify? If so, please do share an example.

Categories:
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Yes you can do something like:

    IF YourCondition THEN
      EXIT;

    this skips the modify if the condition is not met.

    Please remember that this is a bad coding rule. This trigger (onmodify) is executed before the default modify behavior is executed. If an error occurs in the trigger code, the record changes are canceled. We recommend that you do not include code that can stop the user from recording a change in the OnModify trigger on a table

  • Mariam Shaji Profile Picture
    5 on at

    Vendor-Rfq.png

    In the above picture, how can we write the al code, when we click on the request approval, it should check whether Vendor RFQ only is enabled or disabled?

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

    You don't need to write the AL code. You can put a condition filter on your workflow  specifying Vendor RFQ is yes.

    If you want to put the code, you need create a codeunit and plug into the Approval Management event OnSendVendorForApproval

  • Mariam Shaji Profile Picture
    5 on at

    Can you please share the AL code, so I will get a better idea

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans