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 :
Microsoft Dynamics AX (Archived)

Error* "The model element was saved with unparsable source code and cannot be used".

(0) ShareShare
ReportReport
Posted on by

An  event handler class is created for a form extension to handle some new added form controls , when I build the project I face the below error:

(The model element was saved with unparsable source code and cannot be used. Please edit the element in Visual Studio to fix the errors)  in event handler class xpp file , how can I fix this issue ?

*This post is locked for comments

I have the same question (0)
  • Shabir Ahmad Profile Picture
    3,110 on at
    RE: Error* "The model element was saved with unparsable source code and cannot be used".

    Thanks for your suggestion, it also work for me, cut some  piece of code and repaste it this works for me

  • Onyinluv Profile Picture
    7 on at
    RE: Error* "The model element was saved with unparsable source code and cannot be used".

    This error occurred due to an initial action of copying and pasting from one form or table to another.

    On pasting of the field, group, tabs etc that was copied, It had some methods attached to it.

    Kindly view the class, form or event handler with the error, locate the method foreign to the form or event handler with the error and delete it. (copy out your code to a notepad and review it).

  • prodev42 Profile Picture
    270 on at
    RE: Error* "The model element was saved with unparsable source code and cannot be used".

    cutting out some code, repaste, save file, compile solution worked for me..tkx for the tip

  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: Error* "The model element was saved with unparsable source code and cannot be used".

    By the way the heading for this thread "Creating event handler class for form extension in AX 365" was not really pointing to the issue you are discussing in this thread. So I changed it for you. When your issue is resolved please verify the helpful answers and close this thread. Thanks.

  • maram fraij Profile Picture
    on at
    RE: Creating event handler class for form extension in AX 365

    Thank you Zain for your support & knowledge sharing

  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: Creating event handler class for form extension in AX 365

    Well maram maybe someone else has another idea but this is the best to my knowledge for this right now,

    I faced this issue only once and that is how I had to resolve it, after that I build my work after every small change I make. Has not happened to me again.

    I would think that If you keep building your solution along the way properly you shouldn't see it again.

  • maram fraij Profile Picture
    on at
    RE: Creating event handler class for form extension in AX 365

    I just try to find the resolution for such error if I face it another time since making vague changes is not reasonable resolution , also removing the class and adding it again is not the best resolution?  

  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: Creating event handler class for form extension in AX 365

    Did you remove and added the class you are working on?

    Save the code, delete the class completely, rebuild your project.

    After that create the class again, add the code then rebuild. Try doing that.

  • maram fraij Profile Picture
    on at
    RE: Creating event handler class for form extension in AX 365

    I've just tried to rebuild  without making   vague  changes but it does not work

  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: Creating event handler class for form extension in AX 365

    There is no need to rebuild the whole project every single time you make a small change, just keep building while you're making changes and make sure there are no errors, then when you are done making changes. Rebuild your project to sort out any inconsistencies if any.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans