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

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Dynamics GP Converting VBA code to VB.net for Web Client

(0) ShareShare
ReportReport
Posted on by 110

I saw this post: http://dynamicsgpblogster.blogspot.com/2009/07/getting-started-with-vst-winforms-and.html
B
ut need some guidance.

54662.1.jpg
I have a combo boxes in Purchase order namely approver and designation. which has codes in VBA which I need to convert to VB.net so it will work in Web Client.

3312.2.jpg

So as mentioned in the blog, I have to create MS Dynamics GP-Add-in via VST( Visual Studio Tools)

I already ran DAG and imported the assemblies. 

Here is the script I place in GPAddin.vb:


Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports Microsoft.Dexterity.Bridge
Imports Microsoft.Dexterity.Applications
Namespace DynamicsGPAddin1

<SupportedDexPlatforms(DexPlatforms.DesktopClient Or DexPlatforms.WebClient)>
Public Class GPAddIn
Implements IDexterityAddIn

' IDexterityAddIn interface

Sub Initialize() Implements IDexterityAddIn.Initialize

End Sub

Private Sub DDAppName_AfterUserChanged()
Call AssignDesignation()
End Sub


Private Sub AssignDesignation()
If UCase(DynamicsModified.Forms.PopPoEntry.PopPoEntry.LocalDdAppName.Value) = "John Cena" Then
DynamicsModified.Forms.PopPoEntry.PopPoEntry.LocalDdDesignation.Value = "Director"

ElseIf UCase(DynamicsModified.Forms.PopPoEntry.PopPoEntry.LocalDdAppName.value) = "Mark Thompson" Then
DynamicsModified.Forms.PopPoEntry.PopPoEntry.LocalDdDesignation.Value = "Assistant"
End If


End Sub
End Class
End Namespace

What is next? Did I miss any steps?

*This post is locked for comments

I have the same question (0)
  • Christclark Profile Picture
    110 on at
    RE: Dynamics GP Converting VBA code to VB.net for Web Client

    Thanks alot Tim.

    For the sake of others, this is the correct code:

    Sub Initialize() Implements IDexterityAddIn.Initialize

    AddHandler DynamicsModified.Forms.PopPoEntry.PopPoEntry.LocalDdAppName.Change, AddressOf AssignDesignation

    End Sub

     

    After building the project. I copied two dll files: PurchaseOrderEntry.dll and Application.Dynamics.ModifiedForms.dll to Addins Folder. I run GP via browser and it working fine. 

     

     

  • Tim Wappat Profile Picture
    5,703 on at
    RE: Dynamics GP Converting VBA code to VB.net for Web Client

    Currently your DDAppName_AfterUserChanged() will never be called.

    You need to register an event handler. The event handler will link the event that occurred to the event handler procedure you have written. (calling it AfterUserChanged means nothing to the code, it is just a naming there for you to know what it is).

    So in the Initialize method create an event handler that links the fields's event to the .NET method that will handle it,  should look something like this... Inellisense will help you fill it in.

    Sub Initialize() Implements IDexterityAddIn.Initialize

      AddHandler MicrosoftDynamicsGpModified.Forms..PopPoEntry.PopPoEntry.LocalDdAppName.Change, AddressOf AssignDesignation

    End Sub

    Then build and deploy the output to your addins directory of GP and you should be sorted.

    Tim

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans