Options

NAV2017 Controll Add-In: a beginner problem

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 2arjod99xaet.png


It was fired on PetAddin::AddinReady trigger 2uy28e3mpdfq.png

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:
lz9xjrdy0xnd.png

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)

v1jfy833p3h1.png

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)
lz9zfpql0rzf.png

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.
p6kkh3zka8l9.png


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



Comments

  • Options
    zaidtariqzaidtariq Member Posts: 52
    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.
  • Options
    zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    zaidtariq wrote: »
    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 solution
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Options
    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 folders :/
  • Options
    zaidtariqzaidtariq Member Posts: 52
    @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.
  • Options
    zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
Sign In or Register to comment.