Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need more help Louie!

Status
Not open for further replies.

Bobford

IS-IT--Management
Dec 1, 2006
35
US
Louie,

Please see below for what we did and the results we got.



Renamed PDF file to ItemNumber.PDF

Created a .txt file called PDF Script and put in the script as follows:

Dim wsh
PDFPath="C:\Users\Mikes\Desktop"

PDFFile = ItemNumField & ".pdf"

set wsh = CreateObject("WScript.Shell")
Return = wsh.Run (PDFPath & PDFFile,1,False) Set wsh = Nothing

Via the customizer panel, I created a External Link Definition.
Main tab – Text: PDF
Bitmap: Button
Link Settings- Type: MS Script
Language: VBSScript – Visual Basic
File Name: C:\Users\Mikes\Desktop\PDF Script.txt
Execute Script on Client (testing this in a test company on my computer before trying on server)
Options - Default – Nothing Changed


Here is there error information I get when I click on the button in Inventory Inquiry.

MS Script Link Error Information

User... MAS200SERVER
Date... 10/16/2008
Time... 14:28:19

OLE Error Number... 1025
Description........ Expected end of statement
Language........... VBScript

Script Line........ 32
Script Column...... 45
Script Text........ Return = wsh.Run (PDFPath & PDFFile,1,False) Set wsh = Nothing


1 : '
2 : ' Sage MAS 200 system variables
3 : '
4 : MAS_SCR_CMP = "TOT"
5 : MAS_SCR_USR = "MikeS"
6 : MAS_SCR_MOD = "I/M"
7 : MAS_SCR_DTE = "20081016"
8 : MAS_SCR_HWD = "C:\accounting\best\mas90\home"
9 : MAS_SCR_LWD = "C:\accounting\best\mas90\MAS_TOT\imtot"
10 : MAS_SCR_LIB = "C:\accounting\best\mas90\IM\IMWIAA.LIB"
11 : MAS_SCR_PNL = "PNL_MAIN"
12 : MAS_SCR_OBJ = "BT_LINK_1"
13 : MAS_SCR_MSG = ""
14 : MAS_SCR_PFM = ""
15 : MAS_SCR_CS = 1
16 : MAS_SCR_DBG = 0
17 : MAS_SCR_ERR = 0
18 : '
19 : ' form variables passed in by Customizer
20 : '
21 : '
22 : ' language : VBScript
23 : ' file name : c:\users\mikes\desktop\pdf script.txt
24 : ' script begin
25 : '
26 : Dim wsh
27 : PDFPath="C:\Users\Mikes\Desktop"
28 :
29 : PDFFile = ItemNumField & ".pdf"
30 :
31 : set wsh = CreateObject("WScript.Shell")
32 : Return = wsh.Run (PDFPath & PDFFile,1,False) Set wsh = Nothing
33 :
34 :
35 :
36 :
37 : '
38 : ' script end
39 : '
 
This:

Return = wsh.Run (PDFPath & PDFFile,1,False) Set wsh = Nothing

Should be this:

Return = wsh.Run (PDFPath & PDFFile,1,False)

Set wsh = Nothing
 
Louie,

I am working with Bobford on this solution.

We made the change as you suggested, and we are now getting the following error:

MS Script Link Error Information

User... MAS200SERVER
Date... 10/16/2008
Time... 15:29:56

OLE Error Number... -2147024894
Description........
Language........... VBScript

Script Line........ 33
Script Column...... 0


1 : '
2 : ' Sage MAS 200 system variables
3 : '
4 : MAS_SCR_CMP = "TOT"
5 : MAS_SCR_USR = "MikeS"
6 : MAS_SCR_MOD = "I/M"
7 : MAS_SCR_DTE = "20081016"
8 : MAS_SCR_HWD = "C:\accounting\best\mas90\home"
9 : MAS_SCR_LWD = "C:\accounting\best\mas90\MAS_TOT\imtot"
10 : MAS_SCR_LIB = "C:\accounting\best\mas90\IM\IMWIAA.LIB"
11 : MAS_SCR_PNL = "PNL_MAIN"
12 : MAS_SCR_OBJ = "BT_LINK_1"
13 : MAS_SCR_MSG = ""
14 : MAS_SCR_PFM = ""
15 : MAS_SCR_CS = 1
16 : MAS_SCR_DBG = 0
17 : MAS_SCR_ERR = 0
18 : '
19 : ' form variables passed in by Customizer
20 : '
21 : '
22 : ' language : VBScript
23 : ' file name : c:\users\mikes\desktop\pdf script.vbs.txt
24 : ' script begin
25 : '
26 : Dim wsh
27 : PDFPath="C:\Users\Mikes\Desktop"
28 :
29 : PDFFile = ItemNumField & ".pdf"
30 :
31 : set wsh = CreateObject("WScript.Shell")
32 :
33 : Return = wsh.Run (PDFPath & PDFFile,1,False)
34 :
35 : Set wsh = Nothing
36 :
37 :
38 :
39 :
40 : '
41 : ' script end
42 : '


Any idea as to where we go from here? We appreciate your assistance in getting this figured out.

Thanks,

Mike

 
You need to add the fields you will be referencing even if you are not writing back to them.
 
I think you need an ending \ at the end of "Desktop"

PDFPath="C:\Users\Mikes\Desktop\"


Dawn
 
Dawn..thank you for the suggestion. Your suggestion helped point me in the direction to find the fix below.

Louie - I found the problem.

Changed this:

"PDFFile = ItemNumField & ".pdf"

to this:

"PDFFile = ML_ITEM_NO & ".pdf"

We really appreciate the help both of you gave us on this!!


Thanks,

Mike & Bob
 
Ok..one more thing. What code do I need to create a message box that will state "There is no PDF for this Item Number" when someone pushes the button and there is no PDF file for that button. Currently, there is a popup that gives the error information, which I dont want the end users to see.

Thanks,

Mike

 
When I wrote "ItemNumField" I expected you to put in the correct field name. In this case ML_ITEM_NO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top