Macro Server - Info

Macro Server - Info

What Is Macro Server


  1. Central Management of Macros
  2. Macros are stored in the database
  3. Deployed as a Web Service under IIS
  4. Visual Access Controls are Applied to Macros
  5. Provides Extensions to VBScript Environment
    1. SQL Queries
    2. Common VBScript Function Library
  6. Has a Basic Script Editor Included



Server Side – Macro Server

  1. Macro Server
  2. What it does:
  3. Central Deployment
  4. Allows test in test database





Client Side – Loader

  1. Loader
    1. What it does
      1. Bridges Visual VB Script to dotNet
      2. COM interop for dotNet
    2. Synergy No Touch deployment (VE Scripts)
      1. Deploy using Domain Policy with Active Directory
      2. All other dotNet components are pulled to the client from the macro server by Loader




Client Side – Macro Net

  1. Macro Net
    1. What it does
      1. Interaction with the Visual database
      2. Retrieve scripts from the Visual database
      3. Execute SQL queries using the user’s credentials
        1. No passwords in scripts



Client Side – “Macro Stub” Script


Notes
Option Explicit
dim lib, scriptName, serverName
'_______****User Entry Required****________
'Define Script and Server

scriptName = "DistOrd"  ' Distributed Order SET THE SCRIPT NAME HERE 
serverName = "SRISalesDemo“ 
< SET THE WEB SERVER HOSTNAME HERE 
'_____________________________________

set lib = createobject("VTG.Loader.Managed") 
 < LOADER (CLIENT COMPONENT)
lib.ServerUrl = "http://"  & serverName & "/SRIMacroServer" 
< WEB SERVICE
dim util
lib.ActivateObject "util","VTG.Macro.Net.dll","VTG.Macro.Net.Lib“ 
< MACRO NET PREP
set util = lib.GetObject ("util") 
< MACRO NET INSTANTIATED IN VBSCRIPT ENVIRON
util.ServerURL = lib.ServerURL 
< USE THE SAME WEB SERVER 
executeglobal util.Script(scriptName) 
< THE MAGIC HAPPENS HERE



Macro Editor

Storing Script in the database
      Use the tool - REMOVE ALL TEXT TO DELETE




VB Script – SQL Queries


  1. Three SQL Query Functions
    1. ExecuteScalar
      1. Use for Select when expecting a single value
    2. Execute Query
      1. Use for SELECT when Expecting an Array of Data
    3. ExecuteNonQuery
      1. Use for Stored Procedures, INSERT, UPDATE, and DELETE
  2. These are Methods on the UTIL Object
    1. They Connect with the Users DB Credentials


ExecuteScalar

Returns one piece of data

Notes

'ExecuteScalar Test

util.CommandType = "Text"
util.Sql = "Select COUNT(*) FROM PART WHERE DESCRIPTION IS NULL"
MSGBOX "Scalar test " & util.ExecuteScalar




ExecuteQuery 

Returns “array” data
Notes

'ExecuteQuery Test

util.Sql = "Select ID, DESCRIPTION, UNIT_PRICE FROM PART WHERE ID LIKE ‘M%'"

objArr = util.ExecuteQuery

msgbox ubound(objArr ,1) & " Rows, " & ubound(objArr ,2) & " Columns"

'Loop the Array

For row = 0 to ubound(objArr ,1)

  IF MSGBOX ("PartID: " & objArr( row,0 ) & " Description: " & objArr(row,1) & _  " Unit Price:<" & objArr(row,2) & ">",VbOkCancel) = VbCancel THEN          EXIT FOR

  END IF


ExecuteNonQuery

 Returns Status

Notes
'ExecuteNonQuery Test
util.Sql = “UPDATE PART SET FABRICATED = ‘Y’ WHERE ID LIKE ‘MXZ%'"
status = util.ExecuteNonQuery
Msgbox “Udated “ & status & “ Rows.”



    • Related Articles

    • Macro Server - Release Notes

      v1100.1001 2025.05.11 (Beta Release) - Add support for editing Visual ERP Macros - VTG.Loader.dll is now using Framework 4.8 - Update supporting nuget packages to latest release. - VTGMACMT.exe has been renamed to MacroEditor.exe v1100.1000 ...
    • MacroServer Tools

      Check MacroServer Version Attached is a zipfile with 2 files TEST.xml and VMPRTMNT_Test.vms For Visual ERP 10.0 and below, look for VTGMACMT.exe - Supports editing of a given SRI Macro For Visual ERP 11.0 and up, look for MacroEditor.exe - MDI ...
    • Macro Editor - Release Notes

      v1100.1001 2025.05.11 (Beta release) Add support for Visual ERP Macros Add support to search for text Move language highlight to Language\vbscript.xml file to allow user to add to list For best results use MacroServer v1100.1001 which has added ...
    • Common Macro Errors

      This KB will show the most common Issues and solutions to Errors when running Macros in Visual Red Exclamation Icon and blank box when running a Macro Solution 1 Make Sure the Visual Mfg VSCRIPT.dll is registered Open CMD prompt using Run as ...
    • WM-Synergy Macro Editor

      WM-Synergy Macro Editor This is rich client user interface, which allows for the maintenance of Synergy Created Macros that support the Infor Visual ERP Manufacturing, (VE), Visual Basic Scripts (VBScript) typically used in a VE Macro situation. Each ...