Scripting

Expand all | Collapse all

i am a beginner in creating scripts but I am tryin

  • 1.  i am a beginner in creating scripts but I am tryin

    Posted 06-11-2016 20:46
    i am a beginner in creating scripts but I am trying to add a script to a button to open a file folder and I am not getting the sales order number link portion correct. If I remove the sales order number the script opens the folder at the level above. I am not sure what I am missing to pull in the sales order number field Dim obj Set obj=CreateObject(""wscript.shell"") obj.run ""\\uskanzsfl02\apps\acct\Sage2015\SalesOrderDocuments\{SO_SalesOrder_bus_SalesOrderNo$}


  • 2.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-11-2016 20:55
    Should it look like this ""\uskanzsfl02\apps\acct\Sage2015\SalesOrderDocuments\{SO_SalesOrder_bus_SalesOrderNo$}


  • 3.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-11-2016 22:14
    Try like this with the extra \ and no $ ""\uskanzsfl02\apps\acct\Sage2015\SalesOrderDocuments\ {SO_SalesOrder_bus_SalesOrderNo}


  • 4.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-11-2016 22:23
      |   view attached
    This did not work received error the actual path is \\uskanzsfl0\apps\acct\SAGE2015\SalesOrderDocuments\00538062 as 00538062 is the sales order number but I received the error this is what I have tried since the last comment Dim obj Set obj=CreateObject(""wscript.shell"") obj.run ""\\uskanzsfl02\apps\acct\Sage2015\SalesOrderDocuments\{SO_SalesOrder_bus_SalesOrderNo}"" Attached is the error I received.


  • 5.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 03:05
    What type of file are you trying to open? Perhaps you need to add the file extension? Example: ""\\SAGE\Sage\Paperless\Attachments\BM\CAD\""""{UDF_CAD_DRAWING$}"""".pdf


  • 6.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 05:28
    It is a folder not a particular file so no extention


  • 7.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 06:18
    Are you passing the Sales Order number to the button?


  • 8.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 06:22
    Yes the script is part of a link of a button


  • 9.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 07:23
      |   view attached
    Did you pass the Sales Order Number to the script like this? If not, you need to click on ""Select Variables to be Passed to Script"" (highlighted in the picture)


  • 10.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 07:51
    I did add the SO No as a variable but I still am receiving an error see picture


  • 11.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 11:37
    It works if you ditch the curly brackets and dollar sign then append the variable name with an ampersand like this: obj.run ""\uskanzsfl02\apps\acct\Sage2015\SalesOrderDocuments"" & SO_SalesOrder_bus_SalesOrderNo From your postings it is impossible to tell if your folder names include the S/O number as part of the string ""SalesOrderDocuments0053806"" or if the S/O numbers are foldernames alone """"SalesOrderDocuments\0053806"" which would require another back-slash in your string: obj.run ""\uskanzsfl02\apps\acct\Sage2015\SalesOrderDocuments\"" & SO_SalesOrder_bus_SalesOrderNo


  • 12.  RE: i am a beginner in creating scripts but I am tryin

    Posted 06-12-2016 16:21
    Thanks everyone it is working . SalesOrderNo was the folder name so I added the ""\"" before the variable and since it was the server I needed one more""\"" at the beginning.