web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Can't register Policy on Dynamics GP

(0) ShareShare
ReportReport
Posted on by

Hello,

I'm working on adding custom web service to Dynamics GP API. For that I use pdf instruction from microsoft https://www.microsoft.com/en-us/download/details.aspx?id=36223  (or here: https://vdocuments.site/ws-programmers-guide.html)

 Accordingly to instruction, to add Policy Metadata, we need create Windows Console App (page 223, Chapter 29: Adding Policy Metadata) and run it inside C:\Program Files\Microsoft Dynamics\GPWebServices folder.

but when I run app it throws an error: Object reference not set to an instance of an object.

on line of code:

PolicyBusinessService policyBusinessService = (PolicyBusinessService)ServiceFactory.GetServiceInstance(CommonConstants.PolicyBusinessService);

When I debug it, same error

Inner exception is null, stack trace:

at Microsoft.Dynamics.Common.ServiceFactory.GetServiceInstance(String serviceKey)
at InstallPolicyMetadata.Program.LoadPolicies() in C:\Users\user1\Source\Repos\gpsyncextension\src\InstallPolicyMetadata\Program.cs:line 50
at InstallPolicyMetadata.Program.Load() in C:\Users\user1\Source\Repos\gpsyncextension\src\InstallPolicyMetadata\Program.cs:line 92
at InstallPolicyMetadata.Program.Main(String[] args) in C:\Users\user1\Source\Repos\gpsyncextension\src\InstallPolicyMetadata\Program.cs:line 114

Tool has references to all DLLs from C:\Program Files\Microsoft Dynamics\GPWebServices folder as specified in instruction.

What is wrong? Why internal Dynamics API web services method returns error?

Thank you,

Igor

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Dan Liebl Profile Picture

Dan Liebl 2

#2
Shravan Attelli Profile Picture

Shravan Attelli 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans