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 :
Small and medium business | Business Central, N...
Suggested Answer

The metadata object CodeUnit 50139 was not found.

(0) ShareShare
ReportReport
Posted on by 65

Hi,
I have got this unexpcted error in the job queue "The metadata object CodeUnit 50139 was not found.". I created a job queue which runs the code unit to import products using external api call. I uploaded .app extension file and installed it on the sandbox environment and configure job queue which successfully started at the specific time.

The job queue runs almost 42000 iteration and imported around 9000 products. The job time out was 18 hours but it ran almost 9 hours which i checked last time the job queue was in InProcess state it was not stopped.

When i checked in the morning the job queue was stopped due to this error. The metadata object CodeUnit 50139 was not found.

pastedimage1674210254153v1.png

I got this error 2 times yesterday, The first time the same error occurred when i ran job queue By clicking the Run Once Fore Ground Option and as i closed the tab i got this error.

The 2nd time i got this error when i run the project in the debugging mode and set job queue to run on the specific time and when i stopped debugging i got this error again for that job.

To avoid this i created .app file and uploaded and set it's time to start it automatically on a specific time but after almost 9 hours i got this error again in the sandbox environment in this time i didn't do anything.

What could be the possible reason of this and how I can solve this issue i am struggling to know the actual reason of this?

Is there any way from where i can see actual cause of error and system generated exceptions?

  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    Difficult to say form here, but there may be more information in application event log file related to The metadata object CodeUnit 50139 was not found.

    Thank you.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    I can not help you with that specific error. But one design tips would be to try to avoid creating jobs that runs processing for that many hours in one transaction scope.

    You should try to reduce the workload that is handled for each iteration of the job queue job.

  • Suggested answer
    YUN ZHU Profile Picture
    103,767 Super User 2026 Season 2 on at

    Hi, Weird problem, this looks like your objects are not compiled correctly. But you mentioned Sandbox, so this should be the SaaS version.

       

    How did you upload the app files? If you publish directly from VS Code, it may be automatically uninstalled during Minor Update.

    Hope this helps.

    Thanks.

    ZHU

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 727 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 512 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 321 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans