
I was approached recently about an issue that a customer was having with the ServiceUpdateVendor Service Procedure being called as a Service Based Architecture (SBA) web service.
The web service call had worked perfectly on the system before upgrading to Microsoft Dynamics GP 18.5. Once they had upgraded, it was failing with an error.
Here is how GP Power Tools fixed the issue.
The customer was an existing GP Power Tools user and approached Winthrop Development Consultants after Microsoft confirmed the issue was a bug.
The Problem
The issue reported to Microsoft was that when the ServiceUpdateVendor Web Service was called with an attempt to change one of the four Address IDs for (Purchase, Remit To, Ship From or 1099), the code would abort with the error:
10:27:16.200 | [*Error*]::Request Exception (application) :: CorrelationId:[0c5586ac3f6a4b6d80abb6cda3ec10f8], HttpCode:[400], ErrorType:[ApplicationError], Source:[DexterityProcess], ExInfo:[Microsoft.Dynamics.GP.Svc.Foundation.ErrorHandling.RequestException: One or more errors occurred while processing the request. Please see the server logs or the error details in the response for more details.]
Reviewing the logs showed the error was error message 749: “This address ID does not exist.”.
This functionality had worked perfectly before the upgrade to version 18.5 of GP and still worked correctly if the change was made via the User Interface.
The Research
Microsoft Support had looked into the issue and confirmed that some changes to the scripts behind the fields made in June 2022 has broken the functionality when in Service Mode. After I was contacted, I reviewed the code again and confirmed Microsoft’s findings.
The changes made were for the new feature to warn when changing the Address ID if the address is marked as Inactive. In the code this worked by adding an “else” clause to the “if” statement that checked if the address did not exist. For the “else” case it would now check if the address was inactive and if so, display a dialog “This address is inactive. Do you want to continue?”.
The issue is that any dialogs displayed break Service Mode calls, so an extra “if” statement was added checking the isServiceMode() function. It is this extra check that was written incorrectly and so is breaking the code.
Instead of just giving an error when the Address ID is inactive, or just allowing an inactive Address ID (as per previous versions), the check for Service Mode is BEFORE the check for the inactive Address ID and as such it cause any change to the Address ID to fail.
Just to compound the issue, the error message returned is the same error message used for when the Address ID is missing and so it is misleading.
I provided my research and proposed fixes to the code back to Microsoft and the issue has been logged as Problem Report 94336 and will hopefully be fixed in an upcoming GP release.
The Solution
Having the bug identified and logged will get it fixed sometime in the future, but it does not help the customer right now with the current GP release.
This is where GP Power Tools comes in. I created a quick Project with four triggers (one for each of the fields) that runs before the original code. Each trigger checks that GP is running in Service Mode and that the Address ID does exist and then aborts the original GP code allowing the change to be made without generating an error. If GP is not in service mode or the Address ID does not exist, the original code runs as normal.
Problem fixed… or so I thought.
Once the project was imported into the customer’s system and it was confirmed that GP Power Tools was installed on the application instance being used for Service Based Architecture calls, we would have expected it to work. But it didn’t.
This is when I realized that even though GP Power Tools allows for the creation of custom Web Services which can be called by SBA, it actually did not enable any of the custom triggers when in Service Mode.
This was just before the release of GP Power Tools Build 30, so it was perfect timing to get some tweaks into the code to resolve this deficiency. An extra option to mark a trigger as Enabled in Service Mode was added to the Trigger Setup window and the code which runs when logging in for Service Mode was updated to start triggers marked as enabled. The customer tested with a beta build of 30 and confirmed that the trigger was now active, and the service call issue was resolved.
Below are screenshots of one of the triggers:

Trigger Before Field Change event of the Address ID field

Action set to Reject Script if OUT_Condition returned as true

Script checking Service Mode and if the Address ID exists, then setting OUT_Condition = true

New option for Build 30 to Enable a trigger in Service Mode
Conclusion
While the aim was to fix the bug introduced to the ServiceUpdateVendor Service Procedure in Microsoft Dynamics GP 18.5, there were much more and better consequences.
After a review of both Administrator Tools and Developer Tools, Build 30 was updated to enable the following functionality in Service Mode:
- Dictionary Control
- Product Version Validation
- User Activity Tracking
- Security Activity Tracking
- Triggers if marked as Enabled in Service Mode
- Dynamics Trigger Logging was already enabled in all modes
It also enables the following functionality in Dynamics Process Server (DPS) mode:
- Dictionary Control
- Product Version Validation
- Triggers if marked as Enabled in Service Mode
- Dynamics Trigger Logging was already enabled in all modes
This will make troubleshooting, customizing and fixing issues in Service Mode and DPS Mode much easier.
Downloading and Installing
Note: This project requires Build 30 or GP Power Tools and GP Power Tools must be installed on the machine being used for SBA web service calls (it should be everywhere anyway).
Download the example code, import using the Project Setup window:
The code will be active on next login or after switching companies, or you can use start the triggers manually from the Project Setup window.
Hope this helps.
David
This article was originally posted on http://www.winthropdc.com/blog.


Do you happen to know whether or not Dynamic GP’s SBA is still supported in GP 18.7 Oct Release?
Hi Michael
SBA is still supported, but not being developed further. You can use Dexterity or GP Power Tools to create new Service Procedures.
David