Scripting

  • 1.  A client of mine would like me to find a way to au

    Posted 03-22-2017 18:08
    A client of mine would like me to find a way to auto-allocate sales orders for ACS Multi-Bin Picking, and I was considering a scheduled export/import of sorts to trip a database field, but they also came back to me with this suggestion from one of the ACS programmers: ""To do this you will want to have the KSync run a script where you access the Sales Order Header object ""SO_SalesOrder_bus"", pass thru the sales order number, set ""Y"" to the D404_AllocateOrder$ and write the order header back. This is a sample below."" soHeadObj=new(""so_SalesOrder_bus"",cosession) setKeyVal=soHeadObj'setKey(SalesOrderNo$) soHeadObj'setValue(""D404_AllocateOrder$"",""Y"") soHeadObj'write() Is it possible to write to the sales order in this fashion, is it a good/clean option, and how do I actually call Sage to run this script? I'm sure the way I'm phrasing this question all wrong, since I've never done any ""scripts"" outside of Sage besides VI batch files, but hopefully, someone understands what I'm asking :)


  • 2.  RE: A client of mine would like me to find a way to au

    Posted 03-23-2017 17:47
    That's Providex code that you can use as perform logic. Save that text in a txt file then in the job add it as perform logic. I know @AlnoorCassim can explain it better.


  • 3.  RE: A client of mine would like me to find a way to au

    Posted 03-23-2017 18:28
    I'm not sure I understand what you are trying to accomplish or in what order the field needs to be set. Can a table pre-write script not be used? As Robert said, if you were using VI to import records, you could use the ProvideX code but it sounds like ACS is telling you to trigger the script with KSync (Sage Alerts & Workflow), this would require having the ""Actions"" module in order to run a script from it. If you are using KSync, then you can have it trigger a vbscript that can accomplish what you want using just vbscript or you can use the vbscript to ""execute"" the ProvideX code. I use the following snippet if i just need to execute some ProvideX. '############################################################## Dim oShell : Set oShell = CreateObject(""WScript.Shell"") Dim sPath : sPath = """" : sPath = oShell.RegRead(""HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\SOTAMAS90\Directory"") Set oPVXSession = CreateObject (""ProvideX.Script"") oPVXSession.Init(sPath & ""\Home"") ' Make sure to set this path to point to the mas90 folder on the server or read the registry for the path oPVXSession.Execute(""CALL """"..\CM\Script\ProvideX_Code.pl"""""") Set oScript = Nothing Set oShell = Nothing Set oPVXSession = Nothing '##############################################################


  • 4.  RE: A client of mine would like me to find a way to au

    Posted 03-23-2017 19:53
    Thanks for the responses, Robert and David. After looking at the steps involved, I am going to stay away from this project. I will refer the client to our development dept instead, and if they decide to go with a good old fashioned VI import, I'll help them then. I appreciate the input!!