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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Several Statements inside IF...ELSE... C/AL code

(0) ShareShare
ReportReport
Posted on by

Is there a way to ad more than one statement to an IF condition? I.E.

IF txtAccount = 'MAIN' THEN
{
    x = x + 1
    y = y + X
};


thats how I would do it in c# for example but I can't figure out how to do it in C/AL code. I have seen the documentation and I can't find that section.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    IF txtAccount = 'MAIN' THEN BEGIN

       x = x + 1

       y = y + X

    END;

  • Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 on at

    Use BEGIN and END Statements to combine multiple statements instead of { } replace them with BEGIN END.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans