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!

I would like to attach PDF files to Items in MAS

Status
Not open for further replies.

Bobford

IS-IT--Management
Dec 1, 2006
35
US
Does anyone know a way to attach PDFs to items in MAS inventory??

Attaching a JPG is useless to me and PDFs are almost essential in our line of work.

Any ideas or help would be greatly appreciated.

Bob
 
The PDF should be named {item number}.pdf

Next create a script and attach it to a button on the inventory panel. When you click the button it will pull up the PDF. Here is the script:

Dim wsh
PDFPath = "C:\YourPathHere\"

PDFFile = ItemNumField & ".pdf"

set wsh = CreateObject("WScript.Shell")
Return = wsh.Run (PDFPath & PDFFile,1,False) Set wsh = Nothing
 
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 : '
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top