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
I have the same question (0)