Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Open web site from GP window

(0) ShareShare
ReportReport
Posted on by

Hello,

We have a need where we need to add a button in the sales transaction entry and when user clicks the button, we need to open a web site and send document number from the sales transaction entry as query string. Are there any sample code we can review?

Thanks,

Farzana

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: Open web site from GP window

    Thank you all for your reply. I will share these with my team and will see which one will be best approach for us.

    Best Regards,

    Farzana

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Open web site from GP window

    I agree with most of the suggestions given, except VBA part. Biggest drawback of using VBA, in future, is that it's not supported on web client. Using VS Tools, you can check from which client user is triggering this event and then construct the code accordingly.

    Take a look at the code below:

    int iClientType = Dynamics.Forms.SyVisualStudioHelper.Functions.DexRuntimeGetClientType.Invoke();
    String sWebSite = <construct your website URL path with document number as search string>;
    
    if (iClientType == 1) //Desktop Client
        Process.Start(sWebSite);
    else //Web Client
        Dynamics.Forms.SyVisualStudioHelper.Functions.DexUtilityLaunchUrl.Invoke(sWebSite);

    This way, you can make your code flexible, compatible and easy to upgrade.

  • Suggested answer
    Almas Mahfooz Profile Picture
    11,009 User Group Leader on at
    RE: Open web site from GP window
    :( no idea why getting 5. in my code. edited.

    Private Sub yourcaption_Changed()
        Dim objExplorer
       
        Set objExplorer = CreateObject("InternetExplorer.Application")
        MsgBox "http://somewbsite/" & SalesTransactionEntry.DocumentNo & ""
        'objExplorer.Navigate "http://somewbsite/" & SalesTransactionEntry.DocumentNo & ""
        objExplorer.Navigate "http://www.evinciblesolutions.com/index.aspx"
        objExplorer.Visible = 1
    End Sub

  • Community Member Profile Picture
    on at
    RE: Open web site from GP window

    But really what you want?

    What do you mean pop: System.Windows.Forms.WebBrowser? A programmatic argument from C#? You add the button to your window?

    Do you own a C# or VBA code to open an external web page in the browser?

    All actions to level of development can make it by editing window in VS Tools modifier or developing an Addin that references the field or custom control. Usually starting with: Local. Example: LocalBankDate.

    Happy afternoon.

  • Community Member Profile Picture
    on at
    RE: Open web site from GP window

    Thank you all for your reply and suggestion. Our requirement is given as below:

    The button should pop a System.Windows.Forms.WebBrowser that points  to an external page (ex. www.google.com).

    Is it possible to do with your suggestion? Is there any example we can follow to pop a System.Windows.Forms.WebBrowser from GP?

    Thank you again and all help is greatly appreciated,

    Farzana

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Open web site from GP window

    Hello, Farzana!

    Nice to greet you.

    You have several options (Dexterity, VBA with Modifier and VSTools) and my recommended is linked to the response of Souls Mahfooz.

    You require only add a custom button a window or (preferably) an additional menu that redirects to access.

    However, to add a button, I advise you go by the Modifier window and save your edits.

    Subsequently, open the VBA editor after restarting your Dynamics GP enabled the "modified" form from the panel: "Forms / Reports alternative or modified" and you have all the events available to easily create VBA code.

    To do with VS Tools is necessary to compile a new assembly, and reference the DLL from: Modified Forms and implement an AddIn I -step longer, leave for a complex-stage.

    Attach a brief capture and added a field -FechaBanco (in spanish)- and assigned a default by VBA.NET:

    My apologies for the bad English.

    Best regards.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Open web site from GP window

    Farzana, modifier and VBA is also an another option for you as suggested by Almas.  It's very easy and fast.  I would suggest you to think twice in choosing a development tool considering the scope of the future customization.  Hope this helps.

  • Almas Mahfooz Profile Picture
    11,009 User Group Leader on at
    RE: Open web site from GP window

    Don't make your life difficult by doing VS Tools for that short customization, use modifier and VBA winning combination. :)

  • Suggested answer
    Naga Kiran Profile Picture
    on at
    RE: Open web site from GP window

    Hello Farzana,

    If you plan to do it in VS tools, you need to create Application.Dynamics.ModifiedForms.dll once your window modifications are complete. You can refer to https://msdn.microsoft.com/en-us/library/cc543605.aspx how to do that. You should add the Application.Dynamics.ModifiedForms.dll to your GP addin references and register a  event handler on the new button.

    In the event handler script, you may need to construct the URL dynamically based on the DocNumber selected and use HTTPRequest class to proceed further.

    In Dexterity this would be much simpler. You can add the Change script where you add logic to create dynamic web URL based on Doc Number and use "run application" command to open the website.

    eg: run application "",<Your Website Addres>?DocNumber=<Doc Number from the SOP window>

    Hope this helps and let me know if you need any specific info.

  • Community Member Profile Picture
    on at
    RE: Open web site from GP window

    I have limited knowledge with VS Tools, so i cant comment on that.  But with dexterity yes it is possible.  The whitepaper on the below link gives you the complete information of the development tools for dynamics GP.  Dexterity also supports COM.  Hope this helps.

    www.microsoft.com/.../confirmation.aspx

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans