Sage 100

 View Only
Expand all | Collapse all

Button script for V4.4 to open a pdf document. Do

Robert Wood

Robert Wood12-08-2010 17:08

Robert Wood

Robert Wood12-08-2010 17:11

Jim Woodhead

Jim Woodhead12-09-2010 15:55

  • 1.  Button script for V4.4 to open a pdf document. Do

    Posted 12-08-2010 15:33
    Button script for V4.4 to open a pdf document. Does anyone have a sample script for doing this? My client has a PDF document for each of the their items and would like to press a button to open the document. (PDf has the same name as item code.)


  • 2.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-08-2010 16:58
    Ed posted one in the Yahoo group this summer. I'll see if I can find it.


  • 3.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-08-2010 17:08
      |   view attached
    Found it.

    Attachment(s)

    txt
    OpenItemPDF.txt   428 B 1 version


  • 4.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-08-2010 17:09
    Tthat would be awesome. The client was on 3.71 and all the MAS90 Office links went away. so I think this is much easier.


  • 5.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-08-2010 17:11
    I attached it to my previous comment.


  • 6.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-08-2010 17:14
    Thank you so much. I very much appreciate it!! I give it a try tonight. Just get done removing a MalWare from my laptop. A nasty bugger called HDD- Plus. Still don't know how I got it but it is just a time waster!!


  • 7.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-08-2010 22:58
    Unfortunately. I think this script is for non-Business Framework. Anyone know what is different in Business Framework?


  • 8.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-09-2010 03:21
    I'm pretty sure it was for 4.30. What's it doing?


  • 9.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-09-2010 05:57
    This is what we use: Dim wsh set wsh = CreateObject(""WScript.Shell"") Set filesys = CreateObject(""Scripting.FileSystemObject"") PDFPath = ""L:\Products\DrawingsPDF\"" PDFFile = ML_UDF_IMH_DRAWING_LOCATION docPath = ""L:\DrawingsPDF\"" if filesys.FileExists(PDFPath & PDFFile) then Return = wsh.Run(chr( 34) & PDFPath&PDFFile & chr(34),1,False) else Return = wsh.Run(chr( 34) & docPath&PDFFile & chr(34),1,False) end if Set wsh = Nothing


  • 10.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-09-2010 15:55
    Big Louis are you on V4.4?


  • 11.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-09-2010 16:51
      |   view attached
    @RobertWood I am getting an error an Ole Error -214733731 on the this line Return = wsh.Run(chr( 34) & PDFPath&PDFFile & chr(34),1,False) Here is my script: set wsh = CreateObject(""WScript.Shell"") Set filesys = CreateObject(""Scripting.FileSystemObject"") PDFPath = ""D:\SAGE\PDF_Library\drawings\"" PDFFile = CI_ItemCode_bus_ItemCode & "".PDF"" Return = wsh.Run(chr( 34) & PDFPath&PDFFile & chr(34),1,False) Set wsh = Nothing


  • 12.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-09-2010 16:57
    Here is the dump. Any ideas? MS Script Link Error Information User... SQL01 Date... 12/9/2010 Time... 16:55:56 OLE Error Number... -2147023741 Description........ Language........... VBScript Script Line........ 37 Script Column...... 0 1 : ' 2 : ' Sage MAS 90 Extended Enterprise Suite system variables 3 : ' 4 : MAS_SCR_CMP = ""REA"" 5 : MAS_SCR_USR = ""dsd"" 6 : MAS_SCR_MOD = ""I/M"" 7 : MAS_SCR_DTE = ""20101209"" 8 : MAS_SCR_HWD = ""D:\SAGE\MAS90\home"" 9 : MAS_SCR_LWD = ""D:\SAGE\MAS90\soa"" 10 : MAS_SCR_LIB = ""D:\SAGE\MAS90\IM\IM_ITEM.M4L"" 11 : MAS_SCR_PNL = ""PMAIN"" 12 : MAS_SCR_OBJ = ""BT_LINK_1"" 13 : MAS_SCR_MSG = """" 14 : MAS_SCR_PFM = """" 15 : MAS_SCR_CS = 0 16 : MAS_SCR_DBG = 0 17 : MAS_SCR_ERR = 0 18 : ' 19 : ' form variables passed in by Customizer 20 : ' 21 : CI_ItemCode_bus_ItemCode = ""U-4500"" 22 : ' 23 : ' language : VBScript 24 : ' file name : \\sql01\d$\sage\mas90\cm\script\lnk001.txt 25 : ' script begin 26 : ' 27 : Dim wsh 28 : 29 : set wsh = CreateObject(""WScript.Shell"") 30 : 31 : Set filesys = CreateObject(""Scripting.FileSystemObject"") 32 : 33 : PDFPath = ""D:\SAGE\PDF_Library\drawings\"" 34 : 35 : PDFFile = CI_ItemCode_bus_ItemCode & "".PDF"" 36 : 37 : Return = wsh.Run(chr( 34) & PDFPath & PDFFile & chr(34),1,False) 38 : 39 : Set wsh = Nothing 40 : ' 41 : ' script end 42 : '


  • 13.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-09-2010 17:10
    Looks like there's a space in the first chr(34) entry on line 37 and not in the second. ..chr( 34) & PDFPath & PDFFile & chr(34).,


  • 14.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-09-2010 17:18
    Does the file U-4500.pdf exist in the directory? You've taken out the error handling that was in the original and if the file doesn't exist you're going to get an error on that line.


  • 15.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-10-2010 08:08
    The code I am using is based on the code from an example that Steve posted on the Community.


  • 16.  RE: Button script for V4.4 to open a pdf document. Do

    Posted 12-13-2010 11:00
    Update on this issue. The script is now working fine. There were two issues 1st) I hadn't set the script to run on the client and 2nd) My path to the file needed to be a mapped drive. Thanks to everyone for the help.