NAV2017 Controll Add-In: a beginner problem

davide.mazzilli@infostudi.it
Member Posts: 10
Hi to all,
I am quite new in developing Client add-in, so I am having many problems due to inexperience.
I am working on a Dynamics NAV2017 with Client and Application server on same machine (single tenant). Using Visual studio enterprise 2015 to develop the C# part. And, guess, I am completely new to C# world too
(anyway I can read and understand the code, even if slowly and using references).
I started watching every video and reading all the posts I found on the Topic, specially Vjeko ones.
So, here it is the problem.
I tried to implement "Jason Down" solution (Thx Jason I understood a lot of theory from that) of a simple windows form, to share data with NAV. Here the topics jason-down.com/2015/01/01/dynamics-nav-net-add-in-control-with-custom-events-and-eventargs/
I also downloaded the solution and installed in my environment, rebuilding the project and generating the new signed dll. But, running the page I started having problems.
The first one was on page load
It was fired on PetAddin::AddinReady trigger
When I changed all the property of DotNet variables involved (in the functions called after the AddinReady was fired), forcing "Run on client", the problem was solved and the page loaded, sharing some data from NAV ( a table with 2 records) and Framework. This is the result after loading:

Now...the next Step was to press the "Speak" button, hoping the system prompt a NAV message with the "sounds" of the animal (a simple text). The message must be retrieved by .Net part and passed to NAV. Here part of the interface code (the full code is in the first link)

The 2 lines with breakpoint are related to the event I was following.
Here the code on the inner class that handles "button click" (sorry for debugging breakpoint)

Now, pressing on the "Speak" button, I get again the same error of the beginning
But this time I have nothing i can change on NAV side.

Sorry for the bad explanation, I hope it is enough to understand the problem, and, possibly, find a solution
( I bet it is something basic I am missing).
Thanks in Advance
I am quite new in developing Client add-in, so I am having many problems due to inexperience.
I am working on a Dynamics NAV2017 with Client and Application server on same machine (single tenant). Using Visual studio enterprise 2015 to develop the C# part. And, guess, I am completely new to C# world too

I started watching every video and reading all the posts I found on the Topic, specially Vjeko ones.
So, here it is the problem.
I tried to implement "Jason Down" solution (Thx Jason I understood a lot of theory from that) of a simple windows form, to share data with NAV. Here the topics jason-down.com/2015/01/01/dynamics-nav-net-add-in-control-with-custom-events-and-eventargs/
I also downloaded the solution and installed in my environment, rebuilding the project and generating the new signed dll. But, running the page I started having problems.
The first one was on page load

It was fired on PetAddin::AddinReady trigger

When I changed all the property of DotNet variables involved (in the functions called after the AddinReady was fired), forcing "Run on client", the problem was solved and the page loaded, sharing some data from NAV ( a table with 2 records) and Framework. This is the result after loading:

Now...the next Step was to press the "Speak" button, hoping the system prompt a NAV message with the "sounds" of the animal (a simple text). The message must be retrieved by .Net part and passed to NAV. Here part of the interface code (the full code is in the first link)

The 2 lines with breakpoint are related to the event I was following.
Here the code on the inner class that handles "button click" (sorry for debugging breakpoint)

Now, pressing on the "Speak" button, I get again the same error of the beginning


Sorry for the bad explanation, I hope it is enough to understand the problem, and, possibly, find a solution

Thanks in Advance
0
Comments
-
Hi @DavideVD1
Solution1:
It look like you didnt place the required dll in Server Add-ins folder. Try placing the pet.dll (or other related dlls) in the folder 'C:\Program Files\Microsoft Dynamics NAV\100\Service\Add-ins', if you want to run the dll by service tier.
Solution2:
If you want to run dlls at client you have to place dll at client add-in folder 'C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Add-ins' and go to the property of your object which is calling the .Net dll and change the property 'Run as client' to yes.Best Regards:
Zaid Tariq
Dynamics NAV/365 BC Developer at Dynamics 360
please like / agree / verify my answer, if was helpful.3 -
Hi @DavideVD1
Solution1:
It look like you didnt place the required dll in Server Add-ins folder. Try placing the pet.dll (or other related dlls) in the folder 'C:\Program Files\Microsoft Dynamics NAV\100\Service\Add-ins', if you want to run the dll by service tier.
Solution2:
If you want to run dlls at client you have to place dll at client add-in folder 'C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Add-ins' and go to the property of your object which is calling the .Net dll and change the property 'Run as client' to yes.
Agreed with the zaid's solutionBest Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.0 -
Thank you very much. It works.
I supposed it could be something basic,because we were wasting too much time without having effects.
Anyway...I read many pages on MSDN and similar, but it is the first time i read about putting dll on dynamics\server folders0 -
@DavideVD1 Can you please like / agree / verify my answer.Best Regards:
Zaid Tariq
Dynamics NAV/365 BC Developer at Dynamics 360
please like / agree / verify my answer, if was helpful.-2 -
@zaidtariq
No.Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions