I am trying to display an image equal to the Sales Order No using a button script added to the Sales Order Header tab and trying to use a simple script received from Alnoor long ago, but I'm having issues. The current version of the button script looks like this:
Set WSHShell = CreateObject(""WScript.Shell"")
Set FSO = CreateObject(""Scripting.FileSystemObject"")
DrawingFile = SO_SalesOrder_bus_SalesOrderNo + "".png""
WSHShell.CurrentDirectory = ""Q:\Sage 100 Advanced 2016\MAS90\MAS_DBP\Signatures\Sales Order\""
If FSO.FileExists(DrawingFile) Then
WSHShell.Run DrawingFile
Else
strMsg = ""Signature not found""
End If
Set WSHShell = Nothing
Set FSO = Nothing
When I don't pass the SalesOrderNo field, I get my ""signature not found"" message box, but when I do pass it, I get an error that states ""OLE Error -2147023741. Script Line 38, Column 4"" which is equal to this line: WSHShell.Run DrawingFile
What could be wrong with this Run command? Isn't ""DrawingFile"" defined correctly?