Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

call Vendor Lookup Window

Posted on by Microsoft Employee
I want to call the vendor lookup window from a lookup button on a modified General Transaction Entry Window and populate a vendor ID field using VBA. I added the following code to the lookup button change script but the lookup window is not opening. Am I missing something? Private Sub LookupButton7_Changed() Dim GPApp As New Dynamics.Application Dim ErrMsg As String Dim strCommand As String strCommand = "local PM_VendLookup VendLU." strCommand = strCommand + " set VendLU:'Vendor ID' to 'VendorID' of window TransactionEntry. " + vbNewLine strCommand = strCommand + " set VendLU:'Vendor Name' to "". " + vbNewLine strCommand = strCommand + " set VendLU:'Vendor Class ID' to "". " + vbNewLine strCommand = strCommand + " set VendLU:'Payment Priority' to "". " + vbNewLine strCommand = strCommand + " set VendLU:'User Defined 1' to "". " + vbNewLine strCommand = strCommand + " set VendLU:'Vendor Sort By' to 1. " + vbNewLine strCommand = strCommand + " set VendLU:'Return Value' to 1. " + vbNewLine strCommand = strCommand + " call OpenWindowRet of form Vendor_Lookup, VendLU, 'VendorID' of window TransactionEntry. " + vbNewLine GPApp.ExecuteSanscript strCommand, ErrMsg End Sub

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: call Vendor Lookup Window

    Thanks for responding. I followed the method in your article. When the Vendor Lookup window opens, none of the objects in the window are loaded. As you can see from the code my post, I tried the method you used in your follow up article too but the Vendor Lookup window doesn't even open. Now I'm trying to figure out if I'm missing a value that should be passed or if there is an error in my code that is causing the window not to open. I'm not getting any errors so its hard to tell what's wrong.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: call Vendor Lookup Window

    Please follow below article in my blog:

    mohdaoud.blogspot.com/.../how-to-call-gp-lookup-using-vba_1494.html

  • Suggested answer
    soma Profile Picture
    soma 24,406 on at
    RE: call Vendor Lookup Window

    Please have a look on below link.

    blogs.msdn.com/.../avoiding-vba-circular-references-when-using-a-dynamics-gp-lookup.aspx

    Hope this helps!!!

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans