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

Error executing code: Illegal object code. Recompile script

(0) ShareShare
ReportReport
Posted on by 49,438 User Group Leader

I have a standard AX class, as I add any new line of code in it and try to run my process following error message appears

Error executing code: Illegal object code. Recompile script.

Stack trace

.....

Now the point is, I am able to compile this class,

There is no syntax error, there is no error in Generation of CIL, as well.

 

*This post is locked for comments

I have the same question (0)
  • Anton Venter Profile Picture
    20,345 Super User 2025 Season 2 on at

    Hi Sohaib, what steps did you take to try and solve it? Full compile and full CIL compile?

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    I have tried following things:

    1. Generated Incremental CIL
    2. Exported class and reimport
    3. Generated Full CIL
    4. Cleared Usage Data
    5. Compile Forward

    seems something really nasty.

  • André Arnaud de Calavon Profile Picture
    301,018 Super User 2025 Season 2 on at

    Hi Sohaib,

    Can you tell which class was involved and what line of code you added?

    If this class is inherited, try to find the base class and do a compile forward.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    The class in which I am doing customization is CustVoucher.

    Here is line of code, which I am adding, inside the method newCustVoucherJournal

     

    custVoucher.parmLedgerJournalTransID(_ledgerJournalTrans.RecId);

     

    parmLedgerJournalTransID is method which has been created in class CustVendVoucher

    I have compiled CustVendVoucher, too

  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,018 Super User 2025 Season 2 on at

    Hi Sohaib,

    The method parmLedgerJournalTransID is expecting one variable of a type Int64?

    You can try to disable the user option 'Execute business logic in CIL' to see if it can be executed without using CIL.

    To be sure, you can also try a full x++ compile prior to the CIL compilation.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Andre,

    the method parmLedgerJournalTransID  is customized method

    i am passing value by _ledgerJournalTrans.RecId as int64 type value.

    Let me try again with full compile and generation of CIL again.

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Issue has resolved by doing following:

    • Took a backup of Customization
    • Deleted Customized Object (Class) which was raising issue.
    • Made a full Compilation and generated Full CIL
    • Re-imported Customized Lines of code Using Compare Tool
    • Saved and Compiled Customized Objects
    • Generated Incremental CIL

     

     

  • Community Member Profile Picture
    on at

    i have the same error it shows to me when i import opening balance ( ledger with dimension ) Error executing code: Illegal object code. Recompile script.

    this error only happen when i import ledger dimension

    i have import ledger many times and i don't have problem

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

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans