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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Error detected

(0) ShareShare
ReportReport
Posted on by 123

How to fix the error, unexpected token 'public' specified outside the scope of any class or model element in d35 x++

I have the same question (0)
  • Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: Error detected

    Hi, Its suggesting that public keyword is found in the file or code where it should not be. Please share where you are getting this error.

    Also, check this article

    www.daxrunbase.com/.../

  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: Error detected

    Hi,

    Probably you have added the public keyword without creating main method using runnable class.

    Can you show us the screenshot of your code?

    Thanks,

    Girish S.

  • M_R Profile Picture
    123 on at
    RE: Error detected

    pastedimage1683887286496v1.png

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: Error detected

    Closing bracket for the class should be on the last. You have added the method outside the opening and closing brackets of the class.

    Thanks,

    Girish S.

  • Verified answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: Error detected

    This bracket is the issue, add it in the end of the code. 

    pastedimage1683887632399v2.png

  • Verified answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: Error detected

    M_R Please mark answer/s verified that helps and fix your issues.

    If the answers don't work then let us know.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 773 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 624 Super User 2025 Season 2

#3
CU05031448-0 Profile Picture

CU05031448-0 504

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans