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

Cannot create DotNet object?

(0) ShareShare
ReportReport
Posted on by

Hello everyone.
In my organization we have a codeunit that handles electronic billing in Mexico. This codeUnit was provided by our consultant who performed the NAV implementation.

My problem happens when I try to call this codeunit from C# code where it throws me the following error:

Microsoft Dynamics NAV Business Web Services
tried to issue a client callback to create a DotNet object:
dllName.Class (CodeUnit 50204 ConsultantCodeUnit).
Client callbacks are not supported in Microsoft Dynamics NAV Business Web Services.

I debugged the call in the development environment and the error comes when a DotNet variable in the codeunit is initialized. From the cliente application the codeunit works well, The problem comes only when I call the code unit from a webservice in c #.

What can be the error?


Note: I do not have access to modify the .dll

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    You make sure the that DotNet variable property RunOnClient is set to No.

  • Community Member Profile Picture
    on at

    Is there a way to use a DotNet variable for a webservice with the property RunOnClient 'YES'?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    From WS it must be RunOnClient = YES because the .NET object must be run from the Service Tier.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Since the Webservice is running on the sever you don’t need to specify that.

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans