Hi,
I want to read the value of Document Number field from SelectionScroll window in CN_Aging_Inquiry form. I can see the value using warning. How do I return the value to my local variable in VBA? Any help is greatly appreciated.
Thanks
-Divyanshu
Private Sub Grid_BeforeLinePopulate(RejectLine As Boolean)
Dim CompilerApp As Object
Dim CompilerMessage As String
Dim CompilerError As Integer
Dim Commands As String
Dim docNo As String
Set CompilerApp = CreateObject("Dynamics.Application")
Commands = ""
Commands = Commands & "local text code; " & vbCrLf
Commands = Commands & "local string compile_message;" & vbCrLf
Commands = Commands & "local integer context; " & vbCrLf
Commands = Commands & "local string docNo; " & vbCrLf
Commands = Commands & "local integer error_count; " & vbCrLf
Commands = Commands & "{Build the pass-through sanScript code.} " & vbCrLf
Commands = Commands & "context = 1157; { CM } " & vbCrLf
Commands = Commands & "clear code; " & vbCrLf
Commands = Commands & "code =code + ""inout string docNo;"" ; " & vbCrLf
Commands = Commands & "code =code + ""warning 'Document Number' of window SelectionScroll of form CN_Aging_Inquiry;"" ; " & vbCrLf
Commands = Commands & "code = code + ""set docNo to 'Document Number' of window SelectionScroll of form CN_Aging_Inquiry;"" ;" & vbCrLf
Commands = Commands & "error_count = execute(context, code, compile_message, """ & docNo & """);" & vbCrLf
Commands = Commands & " if error_count <> 0 then"
Commands = Commands & " {A compiler error occurred. Display the error.} " & vbCrLf
Commands = Commands & " error compile_message; " & vbCrLf
Commands = Commands & "end if; " & vbCrLf
CompilerError = CompilerApp.ExecuteSanscript(Commands, CompilerMessage)
If CompilerError <> 0 Then
MsgBox CompilerMessage
End If
MsgBox "Invoice No: " + docNo
End Sub
*This post is locked for comments