Function in Script Doesn't Appear in Integration Wizard

The information in this article applies to product: e-Work all versions

Issue

  • When using the e-Work Integration Wizard to call a function or sub in a server-side script, the function or sub doesn't appear in the 'script call' drop-down. If the code is created manually, an error is generated when the Engine attempts to call the function.

    As an example, the e-Work function %Script is correctly used to call the sub MailMergeTest() as follows:

    %Script(VBScript,,%Procedure.Name,%MapName,"MailMergeTest")

    The server-side script contains the following sub, which incorrectly calls the e-Work Print() function:

    Sub MailMergeTest()
      ework.Print("C:\\Temp\\eworkMailMergeTest.doc",ework.FolderId,"","C:\\Temp\\temp.doc")
    End Sub

    When the Engine attempts to execute %Script(VBScript,,%Procedure.Name,%MapName,"MailMergeTest"), it will fail, and an error will be generated on both the client and Engine server.

Resolution

  • If the %Print function were called directly, not through a server-side script, the following is the correct syntax:
    %Print("C:\\Temp\\eworkMailMergeTest.doc",%FolderId,"","C:\\Temp\\temp.doc").

    However, for the example above, the proper syntax is

    Sub MailMergeTest()
      ework.Print "C:\\Temp\\eworkMailMergeTest.doc",ework.FolderId,"","C:\\Temp\\temp.doc"
    End Sub

    Note the lack of parentheses. Once this change is made, 'MailMergeTest' will also appear in the 'script call' drop-down in the Integration Wizard.

  • A syntax error in any function or sub in a script will prevent all of the functions and subs in that script from appearing in the 'script call' drop-down in the Integration Wizard.

Tagged: