Web Services - Great Plains Dexterity Programming Secrets in VB.NET
This article is for advanced Great Plains Dexterity and VB.Net developers. It describes the technique of direct COM objects/Web Services calling in Dexterity.
This article is for advanced Great Plains Dexterity and VB.Net developers. It
describes the technique of direct COM objects/Web Services calling in Dexterity.
Microsoft Great Plains and its current programming language Dexterity
should be considered seriously by developers community and we would like to
popularize the advanced techniques in Dexterity - calling COM objects. This will
enable you as a developer to integrate such nice things as Web Service into
legacy Great Plains interface.
First of all - you need to create your Web Service at your choice - it is
outside of the scope here - we have WildCardWebService created. Then you need to
create COM object. We used VB.Net and Visual Studio.Net 2003.
Public Class AST_ComWildCard
' These GUIDs
provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String =
Public Const InterfaceId As String =
Public Const EventsId As String =
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
Public Function LoadActivate(ByVal localurl As String, ByVal baseurl As String,
ByVal userid As String, ByVal pwd As String,
ByVal sourceid As String,
ByVal cardnum As String, ByVal subprogid As String, ByVal LoadAmount As String,
ByRef response As String, ByRef Description As String) As String
Dim result As String
Dim ws As WildCardWebService
ws = New WildCardWebService(localurl)
result = ws.LoadActivate(baseurl, userid, pwd, sourceid, cardnum, subprogid,
= "URL doesn't respond!" Then
response = "2"
Description = result
<> 0 Then
result.Substring(result.IndexOf("Response=") + 9 + 1, 1)
<> 0 Then
result.Substring(result.IndexOf("ErrorDescription=") + 17 + 1, result.IndexOf("
ErrorDisplay") - 1 - (result.IndexOf("ErrorDescription=") + 17 + 1))
Catch ex As Exception
response = "3"
Description = "COM Object Error!"
result = ex.Message.ToString()
Please - register this COM object via REGASM command.
Now let's open Dexterity. If you don't have it installed - install it from Great
Plains 7.5 or 8.0 CD#2.
In Dexterity open DYNAMICS.DIC and create new Library: Resource
Explorer->New->Library(COM), select your COM object and register. Now it is
ready for referencing in the Sanscript code.
Create Custom Form/Window, create local invisible field '(L) WildCard' this
field should have reference type COM Object and COM Object type will be
available from the list. Place push button which will be calling your COM/Web
Service and add somewhat similar to this code for the button:
'(L) WildCard' of window AST_WildCard =
if '(L) WildCard' of window AST_WildCard = null then
error "Could not create WildCardClassLibrary object.";
'(L) Result' of window AST_WildCard = '(L) WildCard' of window
'(L) WildCard' of window AST_WildCard = null;
And you are done. You are now calling from Custom Dexterity window COM and it in
turn calls web service. Web service returns parameters back to COM and you are
getting them back in your good-old-days Dexterity customization.