Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi ,

A Dotnet Variable has not been Instantiated. Attempting to call, this error message will pop up when trying to call  a .Net Framework Assembly from CAL code.

When I tried to call .Net Framework Assembly I will get above mentioned error message.

Any help to solve this issue would be much appreciated.

Thanks,

Dinuka.

*This post is locked for comments

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

    Because if RunOnClient = No the DLL must be placed in the addin folder of the service tier (Service folder) not in the Role Tailored Client.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

    This is clear from title of property.

    The question is: Why the same dll working with RunOnClient - Yes property and not working with RunOnClient - No property? Why it might be? - That's the question.

    Server and Client working at the same machine, for example.

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

    RunOnClient must be set to YES if you want that this instance of DotNet class is executed at client side. If set to NO, this is executed at Server side.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

    Hi Tharanga Chandrasekara.

    Could you explain why the property "RunOnClient" should be set to Yes? Is it necessary?

    I'm asking because i get the same error message when i'm trying to upload data from .xls file to NAV using Task Scheduler and codeunit 12416.

    File format could not be changed

    Using counstructors as xlApp.ApplicationClass or xlapp.Application of Microsoft.Office.Interop.Exccel also lead to error.

    Thanks.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

    Thanks Mohana and Tharanga !! it works now :) :)

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    Tharanga Chandrasekara 23,116 on at
    RE: A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

    Hi Dinuka,

    Two things you need to do here.

    1. Instantiate your .NET variable by calling the constructor of the class

    TesttoSpeach := TesttoSpeach.Class1;

    2.  Set the "RunOnClient" to Yes. To do that go to your page and design it and then go to your variable. Then go to properties of the variable and set the RunOnClient to Yes. 

     

    Compile and run your code! :)

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 60,153 Super User 2025 Season 1 on at
    RE: A Dotnet Variable has not been Instantiated. Attempting to call - Dynamics NAV 2013

    Please check this blog

    marshaldynamicsnav.blogspot.in/.../a-dotnet-variable-has-not-been.html

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans