[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 46
  • Last Modified:

Launch web page from a Dynamics GP 9 Form

I have a Dynamics GP 9 form with a added button that a previous developer had added which would pass a part number and launch an internal web page.

I need to add a similar function to another form but for the life of me I can't figure out how that was done
  Any help?

Thanks
0
jdr0606
Asked:
jdr0606
  • 2
1 Solution
 
Steve EndowMicrosoft MVP - Dynamics GPCommented:
Hi,

I've never done that specific type of customization to launch a browser, but there are two techniques that I can think of to do that.

When you open the existing window with the custom button that opens a web page, look at the title of the window, in the upper left corner.  Do you see a period before or after the window name?  If so, that indicates it was modified using the GP Modifier & VBA tool.  If this is the case, try pressing ALT+F11 to open the VBA editor and let me know if you see some VBA code.

If there is no period before or after the window name, that likely indicates it was modified using Dexterity, the native Dynamics GP.  In that case, it is a customized Dex window and wouldn't be something you could reproduce without knowing Dexterity.

Let me know what you find.

Thanks,

Steve Endow
Microsoft MVP - Dynamics GP
Dynamics GP Certified IT Professional
0
 
jdr0606Author Commented:
I have resolved the issue myself.

The form in question already had VBA and form modifications (. before and after)

I opened the form to modify and added a button.
Moved the button to the desired location on the form and changed the field name reference (optional), in my case I used "PrintDocuments"
Saved the modified form
Opened the form as normal in GP and then selected the Tools-Customize->add fields to Visual Basics and clicked on the new button on the form (representing "PrintDocuments")
I then opened the VBA editor selected the code for the modified form and then selected the code reference "PrintDocuments" location for the named button field and then added the desired VBA code something like this

Private Sub PrintDocuments_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
Dim Str1 As String
If DocumentNo.value = "" Then
    MsgBox " Document number is blank"
Else
    If TypeTypeID.value = 1 Or TypeTypeID.value = 2 Then
         
               Str1 = "http://anyurl.com"
           
            ShellExecute 0, "open", Str1, 0, 0, 1
    Else
        MsgBox "Can only print Order or Quote"
    End If
End If

End Sub
0
 
jdr0606Author Commented:
Resolved myself and entered the result in the ticket
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now