D365 Financials in the UK with VAT (Tax) registration lookup feature

The month of May 2017 has brought Microsoft Dynamics 365 Financials to the UK market, in preview. Maybe Microsoft saw my blog post from 2013 about enabling VAT lookup in Dynamics GP and applied the same method to NAV and now to D365F.

2017-05-03_13-44-56

VAT Numbers

If we are registered for sales tax in the UK (or Europe) then a VAT registration number is issued, a number that our tax affairs then applied against. Other companies must be given that VAT number when trading with you. Each country has a different format for the VAT number, Gov.UK list them out here, EU country codes, VAT numbers and VAT in other languages.

When supplied with a VAT number from a customer, it is a good idea and your duty to check that the VAT number is valid. Luckily there is a webservice published by the EU for doing this, VIES. In that blog post of mine (and in production since then), I harness this webservice in Dynamics GP to validate VAT numbers coming into the system through integrations and also provide a VAT validation screen when changing debtor VAT numbers. D365F now lets us do something similar with the same source webservice.

VAT validation configuration for Dynamics 365 Financials

So where is it and how do we configure it for use?

In D365F go to: Setup & Extensions>> Service Connections>> EU VAT VAlidation Service Setup

In passing, notice how, at the time or writing this has a nice uppercase typo on the menu option for this option, “VAlidation”.

VAT Tax Registration Configuration Dynamics 365 Financials

The URL for the webservice is editable so long as the enabled check box is unchecked (default http://ec.europa.eu/taxation_customs/vies/services/checkVatService). I guess you could publish your own endpoint, so long as it mimicked the real one, or if the service moved it can be edited, or if you have a proxy address enter it here.

Click the Apply Default values button. Note that I think that the Tax Information Exchange System Setup button should really be disabled, it does nothing no matter what combination of clicking I do.

Check the “Enabled” checkbox.

Agree with the dialog that we are passing our customer info (VAT numbers) to VIES.

You are accessing a thrid-party website and service

Finally press the X on the window to exit, your changes will be saved automatically and the Service Connection will show as “Enabled” as shown below.

Service Connections

Let us see it in action

By creating a new customer let's see what enabling that feature has given us. I’m pretending to set up a customer as Amazon, that have a Luxembourg VAT number of "LU 26375245".

Under the Invoicing section of the customer window, use the “show more” link on the right to expand the fields to show everything useful (I don’t like all the "show mores" dotted around D365F). After clicking show more, you get the Tax Registration No. field revealed.

If I set the country on the address to GB and then try to enter the above VAT number it complains with a standard form validation that the country does not match the VAT number country. This is true if the format does not match the appropriate regular expression for that country set in the customer invoice address.

 

The entered Tax Registration number is not in agreement with teh format specified for the Country/Region Code

To clear the validation I found I had to empty the field, tab off then go back in with the correct value, feels a bit naff. If I change the country to LU and take out the space in the number then on tabbing off the Tax Registration No. field I get the usual two arrows "busy working" icon, a pause whilst the webservice is called, then the following dialog.

The Tax registration number is valid. Do you want to update the name and address?

Selecting Yes fills in the company name of the customer record for us, very nice!

Amazon Customer card with name inserted

If I were to enter an invalid VAT number for a non existent company, we get the following error…

We didn't find a match for this number. Verify that you entered the correct number.

 

So that is a useful feature tested, a feature that I understand the desktop NAV had and a feature I added to GP some time ago and is now also in D365F!

One last issue to point out is that the webservice does become unavailable on a regular basis- presumably when it gets over loaded or a member state's sub section of the service is down. Just bear that in mind if you encounter issues while testing, might not be you!

 

Let me know if you found this useful with a comment, motivates me to keep blogging...

 

Bad Power Value from searching on master number in sales transaction smartlist–Dynamics GP

Searching on the Master Number field in the normal Sales Transactions smart list in Dynamics GP can cause an error to occur. In the following screenshot you can see the search, nothing odd there?

Sales Transaction Smart List

However on executing the search the following error occurs:

Unhandled script exception:
Bad power value
EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE
SCRIPT_CMD_POWER

This is shown below, both the screenshots are of the same dialog, with the error scrolled down to read it.

Error Dialog EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE SCRIPT_CM_POWER

Error dialog: Unhandled script exception Bad Power Value

What  causes this? The error from an internet search seems to occur in reporting when formatting numbers into text, this was the clue I needed. If someone has configured the master number field to be formatted with a comma separator, then this will make the field unsearchable due to this error.

To correct the issue, check the format of the field. Click modify on the smart list results window, this will launch the SmartList Builder window. Locate the Master Number Field and click its display name to get the row selected. Then click the field options icon as shown in the screen shot below.

Smart list builder

The field options window will open, uncheck any formatting in this window, in this case, take off the show thousands separator.

Set Field Options smart list builder

Save the options window and then the SmartList Builder window.

Attempting the same search again will now work normally with no exceptions.

Inspired from the forum post: Sales Transactions Smartlist - error searching for Master Number

If this helped let me know with a comment, it motivates me to blog more!

Could not load file or assembly Microsoft.Dexterity.Bridge.dll or one of its dependencies – Dynamics GP

When developing Dynamics GP addins, the above error can occur for a number of reasons. It generally means what it says, the referenced assembly is looking for a resource it can’t find on the available search locations. If this is encountered whist developing a Dynamics GP addin while attempting to run the addin as an application outside of GP (say in debug from Visual Studio), then this error may well be encountered. What the developer may find odd is that it will work when ran from GP as an addin. Why is this so?

Could not load file or assembly Microsoft.DexterityBridge.dll

The “bridge dll” is the eventing route between GP and .NET applications (including addins) but it has other dependencies from the dexterity shared components. These are required to be present on the standard system environment paths searched when looking for dlls (search online for dll dependency search paths for more info).

When the addin is ran normally, as an addin by the Dynamics  GP process, the dependencies are provided by Dynamics GP process, from the process’s application folder. When running a free standing GP app, from the debug folder of Visual Studio, then the dependencies must be made available to the application through putting the dlls in the .net application’s folder (or other path that will be searched).

By placing TNTLIB.dll and DDAPI.dll into the bin folder should solve the problem. Strictly speaking xdll32.dll and Bidi32.dll should be included too (search online for stand alone Dexterity applications). In Visual Studio this can be achieved consistently by including the files in the project and setting them to copy to output. However it may be preferable to only do this for debug builds, that should be possible with Visual Studio post build steps or manually. 

The following are the files that should be included if running stand alone.

File Description
Tntlib.dll Library used by other dlls and executables
Ddapi.dll Data Dictionary API –provides access to Dexterity dictionaries
Bidi32.dll Additional dependency for dexterity  (My guess is: BiDirectional Convert Ansi To Oem code page, I think it converts extended languages that go left to right and right to left to oem code page characters and back again)
Xdll32.dll Dex gateway to other 32bit dlls
 

Just as a reminder, we should already be familiar with the usual .NET dlls required for .NET addins that would normally be referenced:

File Description
Microsoft.Dexterity.Shell.dll .NET managed shell
Microsoft.Dynamics.Framework. UI.Navigation.dll .NET navigation
Microsoft.Dynamics.Framework. UI.WinForms.Controls.dll .NET windows controls.

Please comment if you found this useful – motivates me to keep blogging…

Fabrikam Day 12th April 2017

Around the world people are posting photos of local landmarks and a #FabrikamDay banner, just for fun and to celebrate a sense of community around our product, Microsoft Dynamics GP.

Here is my contribution in front of The Angel of the North

FabrikamDay  - North East England

The date is a random date that was in the future, chosen to be used for the test company data in Dynamics GP.

fabrikam date

For more information on this read
Fabrikam Day! post by Amber and the

Post by Njevity To Go
Attention Dynamics GP Customers and Partners: We Need Your Help to celebrate Fabrikam Day!