Skip to main content
Submitted by Suzanne Scanlan on 22 May 2020

ArcherPoint Dynamics NAV / Business Central Developer Digest - Vol 294

ArcherPoint Dynamics NAV and BC Developer Digest Blog

The Dynamics NAV and Business Central community, including the ArcherPoint technical staff, is made up of developers, project managers, and consultants who are constantly communicating, with the common goal of  sharing helpful information with one another to help customers be more successful.

As they run into issues and questions, find the answers, and make new discoveries, they post them on blogs, forums, social everyone can benefit. We in Marketing watch these interactions and never cease to be amazed by the creativity, dedication, and brainpower we’re so fortunate to have in this community—so we thought, wouldn’t it be great to share this great information with everyone who might not have the time to check out the multitude of resources out there? So, the ArcherPoint Microsoft Dynamics NAV Developer Digest was born. Each week, we present a collection of thoughts and findings from NAV/BC experts and devotees around the world. We hope these insights will benefit you, too.

Using a Custom DLL in Dynamics NAV 2018

Ryan asks: “I'm trying to use a custom DLL in NAV 2018. I can't get past this error: 
Cannot load an instance of the following .NET Framework object: assembly BTPS.ShippingRate, Version=, Culture=neutral, PublicKeyToken=59794068db52ed5a. 
Here's what I did: 

  1. Dropped the DLL in the Add-ins folder on the computer I'm using
  2. Verified that the dotnet variable is set to RunonClient = yes 
  3. Entered the add in in the control-add ins list in NAV 
  4. Restarted NAV 

I also tried removing the version from the subtype (heard that works). What am I missing? I haven't tried installing it on the server itself, but I don't remember if it needs to be in both places.” 

Suresh responds: “Drop the DLL on the server add in folder, and in the client add in folder 

Kyle: I know you have RunOnClient set to yes, but Suresh's idea is a good one. Try putting it in the add in folder of the service tier. 

Ryan says: “Thanks, guys. I’ll give it a shot.”

Error Posting to OData Web Service in Dynamics NAV 2013 R2

Michael says: “I'm not as familiar with consuming NAV OData web service as I am with SOAP. A client is experiencing an error attempting to POST data to a NAV 2013 R2 OData web service (OData V4 not yet available in this version). It looks like authentication and payload schema validate, but after we get all that right, we see a weird error:

{"statusCode":400,"body":{"odata.error":{"code":"","message":{"lang":"en-US","value":"Cannot process the request because the default Microsoft Dynamics NAV company cannot be found. You can specify a default company in the service configuration file, or specify one for each tenant, or you can add a query string in the form of \"company=[name]\". You can see the available companies by accessing the default OData web service, Company. For more information, see \"OData Web Services\" in Help."}}} 
I'm pretty sure I have the OData formatting and client values correct. If I try a GET request to this endpoint or throw it in the browser, it returns data. Any chance you have any insight about what might going on here? GET works fine ... meaning, they can retrieve data from the OData web service just fine. The problem is POST. I've pointed out issues with URL encoding of the company name, and they replied they tried various permutations with the same result. When they embed a company name that does not exist, they get a different error, so there's at least some validation occurring.”

Matt T. answers: “Not all that helpful, but a note: I have never been able to post entries to a list page. I have never found a working example, and my fallback has always been one of two things: If performance is a cause for concern, I just create a codeunit to accept the data and parse it that way. If it's not a concern, I just publish a card page.”

Michael responds: “We don't want to embed a default company in the service tier CustomSettings.config file because multiple companies will need to receive the POST data. 
Thank you for the helpful tip, Matt! Created a card page object and published and sent that URL to them to try.“

If you are interested in Dynamics NAV and Business Central development, be sure to see our collection of NAV/BC Development Blogs.

Read the "How To" blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV and Dynamics 365 Business Central.

Blog tags