Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Control Addin Javascript Error Handling in BC21

Posted on by 5
Hi,
 
i am developing a control addin in BC21 (Version 21.0.46384.46844),
which is running Javascript internally.
My problem is, whenever an error occurs inside the Javascript, like a "TypeError: Cannot read properties of null (reading 'c1Height')",
the error is not popping up anywhere, and it is not written to the Javascript console in the Developer Tools of the browser.
I could only detect that an error occured by debugging the Javascript calls.
It appears that there is some "controlAddInError" function in client.js, that handles the error.
 
Is there any way to configure the app, so that Javascript errors in the control addin are at least written to the console?
I don't want to put try-catch-blocks everywhere.
 
Best regards,
Jan
  • Suggested answer
    Sami Ullah Profile Picture
    Sami Ullah 280 on at
    Control Addin Javascript Error Handling in BC21
    Hi,

    I tested the solution in BC version 24*, and it's logging errors to the console perfectly.

    Thank you!

  • JB-09100917-0 Profile Picture
    JB-09100917-0 5 on at
    Control Addin Javascript Error Handling in BC21
    Thanks, Khushbu, but unfortunately that doesn't answer my question. 
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 2,325 on at
    Control Addin Javascript Error Handling in BC21

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,572 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,792 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans