Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

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

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

  • Christclark Profile Picture
    Christclark 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
    Tim Wappat 5,701 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans