Making Tax Digital App - OnPrem scope
Hello,
I wanted to ask about the OnPrem scope of some methods from the GB app called Making Tax Digital. I need to use the app for other countries, but on SaaS it's only supported for GB. I was advised by MS to use the source code and create a custom app (based on the MTD)
I wanted to know why these methods have the OnPrem scope, whether this can be changed and if so, then when
-
Codeunit 50511 "MTD Mgt." uses two methods marked as OnPrem defined on table 737 "VAT Return Period"
- FindVATReturnPeriod()
- DiffersFromVATReturnPeriod()
-
"Codeunit 50501 "MTD OAuth 2.0 Mgt" subscribes to the OnBeforeDeleteEvent() with a parameter on table 1140 "OAuth 2.0 Setup". The table contains different methods for handling the Token - all marked as OnPrem. They only handle token stored in the IsolatedStorage, so doesn't really make sense to have them only as OnPrem.
-
"Codeunit 50501 "MTD OAuth 2.0 Mgt" subscribes to the OnBeforeRequestAuthoizationCode() and uses OAuth2ControlAddIn() page which has three OnPrem methods:
- SetOAuth2Properties()
- OAuth2ControlAddIn()
- OAuth2ControlAddIn()
Maybe except of the last controlAddIn methods, the rest seem to be replaceable by the custom code if needed (the controlAddIn would have to be created from scratch). Nevertheless, none of them seem to require the OnPrem scope. Any idea why it was done like that in the first place?
Thanks!
Hey @AlexanderYakunin - is it ok for me to create a pull request with the described changes? It's kinda urgent : )
This is not an extensibility matter, but different questions about regulatory functionality. I cannot answer your questions and forward this ask to another team responsible for this area.
Can you provide more information who in MS advised you to do this? What is the scenario when you need MTD for other countries?
@AlexanderYakunin
Customer requirement: The client's head office is in Switzerland and therefore the client is using the CH localisation of Business Central cloud. Within the Swiss company, the client has offices in other countries with local VAT registrations e.g. the UK with the need to submit VAT returns electronically. Unfortunately, the Making Tax Digital app from Microsoft can only be deployed in a UK localisation of Business Central.
Service request / proposal: We have since engaged with Microsoft and raised a service request (Request ID: 2209220040006331) to get access to the source code for the MTD app. The proposal is that we as a Partner creates a custom version of the MTD app which Partner/ the client as ERP software provider will register with the UK tax authorities. We are aware that this includes testing and certification with UK tax authorities. The Microsoft support consultant [email protected] advised us to log queries regarding the source code via Github.
Hey @AlexanderYakunin Any news regarding my last comment?
Hi! We agreed to remove OnPrem for table 737 "VAT Return Period" and table 1140 "OAuth 2.0 Setup". Will be done for v.22 and v.21. Expect to get it beginning of next week.
Hey @AlexanderYakunin
And what about Page OAuth2ControlAddIn? The page still uses OnPrem markings, even though the code suggests that it shouldn't be the case. If you look at the codeunit 10538 "MTD OAuth 2.0 Mgt" and the below piece of code, then if we are dealing with the SaaS environment the code skips the highligted part and runs further, but all the methods on OAuth2ControlAddIn like:
- SetOAuth2Properties
- GetAuthError
- GetAuthCode
are marked OnPrem - see second screenshot.


Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 47971.