Disable Enhanced Intrastat Dynamics GP

I have fallen out of friends with the GP Intrastat module, it has caused me problems with side effects in different parts of GP over the years. After another such incident, I decided it had to go, but I found it was not so obvious how to switch it off…

Microsoft Dynamics GP>> Tools>>Setup>> Company>>Company

Select the options button

Dynamics GP Company Options Window

The company setup options window will allow access to the “Enable Intrastat Tracking” option. Try unchecking the checkbox. You will get the following dialog.

Please detach all debtors, creditors and sites from all declarnts before you unmark Intratat Tracking

Please detach all debtors creditors and sites from all declarants before you unmark Intrastat Tracking

Microsoft Dynamics GP>> Tools>>Setup>> Company>>Enhanced Intrastat>>Setup

Intrastat Setup Window

You must ensure all users are out of the system before taking the next steps, as this changes the behaviour of the UI and back end. In the Intrastat Requirement Setup window, select unmark all then ok the window.

Go back to the company options window, you may now be able to deselect the intrastat module.

You must then log out of GP and back in again, this will remove the buttons etc that are related to the Intrastat module.

Please be aware that this will stop recording of Intrastat figures, make certain that your intrastat returns can be completed in some other way before disabling this module.

I used the word “may” above, as this worked for our test copy of our production company, but when it came to applying this to production over the weekend, it behaved differently, still throwing the above dialog.

Detaching declarants using SQL

As there does not seem to be any documentation around removing the module and it is holding up some other critical projects, I ran the following SQL script to essentially do what it was asking me to, remove the declarants.

Using DML SQL to query to search for tables containing the field DECLID, we find (for this version of GP and our modules), the following tables:

EDCEI016
VAT10302
*RM00102
*RM00101
*PM00200
*IV40700
EDCEI021
*PM00300

The tables marked with a * are the ones linking the sites, debtors and vendors to declarants. So lets remove the references to the declarant, backing up the data, just in case…

SELECT CUSTNMBR, ADRSCODE, DECLID INTO RM00101_IntrastatBackup 
FROM RM00101 WHERE DECLID!=''
UPDATE RM00101 SET DECLID='' WHERE DECLID!=''

SELECT CUSTNMBR, ADRSCODE, DECLID INTO RM00102_IntrastatBackup 
FROM RM00102 WHERE DECLID!=''
UPDATE RM00102 SET DECLID='' WHERE DECLID!=''

SELECT VENDORID, DECLID INTO PM00200_IntrastatBackup 
FROM PM00200 WHERE DECLID!=''
UPDATE PM00200 SET DECLID='' WHERE DECLID!=''

SELECT VENDORID, ADRSCODE, DECLID INTO PM00300_IntrastatBackup 
FROM PM00300 WHERE DECLID!=''
UPDATE PM00300 SET DECLID='' WHERE DECLID!=''

SELECT LOCNCODE, DECLID INTO IV40700_IntrastatBackup 
FROM IV40700 WHERE DECLID!=''
UPDATE IV40700 SET DECLID='' WHERE DECLID!=''

The above script worked for me, but I can not recommend you use it unless you have fully tested and know your install of GP does not have any other quirks that need addressing (sensible disclaimer!). Certainly something like this should involve your support partner…

Remember to put those backup tables somewhere safe, so they don’t have any danger of upsetting a future upgrades or sitting there forever (probably another database or export them then delete).

Now you will be able to uncheck the intrastat check box.

Remember to log out of GP and back in to see the changes.

This will break and switch off your intrastat module installation and historical reporting, so make certain you are not going to need anything from it before you do this!

You may want to remove the intrastat history too using the GP remove history menu before turning off the module. I’ve chosen to remove leave it there for now, I’ll remove it at a later point in time. I also cleared VAT10201 and VAT10101 tables to back up tables, just to highlight sooner rather than later where we might have integrations (I know we do) and jobs (I know we do) interacting with those tables.

After effects

After switching off the module some flaky bits of GP started working again, such as product suggestions and rolling down address changes to lines, after they have been changed in SOP.

rolldown address prompt

Bizarrely some mods I did a long time ago, but didn’t work and I left in place, started working, even though I’d moved on and used a work around since. Luckily the after effects were all positive, I’m now happy I’ve turned off this pesky module!

Also please note that if you use the country of origin and tax commodity code fields in item maintenance, these are turned off and on by the intrastat module being disabled. I don’t see why even those who do not use intrastat should be prevented from using these fields.

Item Maint window in GP showing optional content

I used a visual studio addin to re-enable those fields on the form.

ItemMaint.TaxCommodityCode.Show()  
ItemMaint.TaxCommCodeDesc.Show()  
  
ItemMaint.CountryOrigin.Show()  
ItemMaint.CountryOriginDescription.Show()  
  
ItemMaint.LookupButton5.Show()  
ItemMaint.LookupButton7.Show()

Do comment on your experiences too, motivates me to write more!