How to run two scripts after VI job across each invoice in batch?

SOLVED

I have a VI Job that imports sales order invoices into a batch. I have scripting that does some zip code validations and then uses scripting to interact with 3rd party integration buttons that are installed (Vertex tax software). The scripts work perfectly during manual operation, but because the VI job is importing to tables the events that normally trigger the scripts aren't taking place. How can I fire these off after the VI job? I suspect I use Perform Logic but I have no experience with Perform Logic and need some help understanding how to tell MAS to run those scripts on the newly created batch from VI. One script is a UI script for all users all companies and is an Panel-On Exit trigger. The other is a Business Script and is a table pre-write.

  • 0

    If you change your scripts to be based on business object events (PreTotals, PreWrite...) instead of UI button clicks, they will work with VI automatically. 

  • 0 in reply to Kevin M

    Unfortunately Kevin, for whatever reason that doesn't appear to be the case. I don't know if its the way that Vertex created their addin or my script is bad or what, but the script isn't firing off after the import and this is the business object script based on Table PreWrite. Please note this script works perfectly during manual creation/processing of an invoice and has been used for a couple years now successfully.

  • 0 in reply to EArter

    Is the 3rd party integration based on BOI, or fully reliant on their UI buttons?  If you invoke their button from your script, there is no UI within VI to know what that means.

  • 0 in reply to Kevin M

    I think its reliant on their UI buttons unfortunately. I've tried asking them before and they are unwilling to share, for obvious reasons. They didn't do a fantastic job of business logic design so I scripted my own over top of their solution (still worth it compared to Avalara's pricing) to make up for their short comings. So yeah I guess you are right, VI doesn't know about it. Is there any way to use Perform Logic or another method to invoke the scripts? Thanks for your help, I've been struggling with this one.

  • 0 in reply to EArter

    I'm not the right person to answer that question.  I imagine you'd need to have Perform Logic open the UI and click the buttons, but I have no idea if that is possible.

  • 0 in reply to Kevin M

    Okay, hoping Dawn F or someone might know. I'm pretty amateur at all this stuff, just know enough to get myself into trouble 

  • 0 in reply to EArter
    SUGGESTED

    You'll need to determine exactly what commands their buttons are executing, they could be either executing scripts (like vbs, js, or provideX) or calling methods that have been added as class overrides. 

    You can determine this by using Data File Display And Maintenance to open the .m4l file that contains the customizations. Depending on how the customizations were added, they should be either in MAS90\SO\Custom\<sub folder for user & company> or MAS90\SO. Not sure if they are added to Sales Order Entry (SO_SalesOrder.m4l) or Invoice Data Entry (SO_Invoice.m4l) so you need to open the correct library.

    Once opened in DFDM, search for the button by name, you can open the panel in Customizer and select the button and view its control name in the status bar in the lower left.

    Once you have located the button record, look at columns 13 and 24. See below for example of a custom button that executes a vbscript.

    If column 24 is blank, then there should be a class method of the same name as the control that should be called when the button is clicked.

    If you can figure out the method name and any applicable arguments, you should be able to call it from perform logic in VI. The exception to this would be if the methods only exist in the UI's class overrides and not the business object's.

    Regarding the existing scripts, as Kevin said, the UI events will not be triggered by VI although the table event should be however you will need to inspect the script to see if it contains any one (of many) or more ways to limit a script to a certain start program, class, role, and/or other specific criteria that would cause it to exit early or not process the part of the script you are expecting to be processed.

  • 0 in reply to David Speck

    David thank you! I will give this all a look this week!

  • 0 in reply to David Speck

    So I'm just now digging into this and found the button I want to execute from the 3rd party after my VI job. 13 and 24 are blank in DFDM on SO_Invoice.M4L - 21 has the value "FD<" without quotations. Field 22 has the value MAIN. Field 38 has the value FTL. Any ideas of where I can go from here? Backing into the 3rd party stuff I'm a bit ignorant as to the process. I know they have some other files in the SO folder named SO517_VertexInvoice_ui.pvc and SO517_VertexInvoice_bus.pvc which is probably where the button is calling from but I don't know how to read the contents of those files or if VI perform logic can even interact with their routines if I could. Unsure of the programming language they use.

  • +1 in reply to EArter
    verified answer

    That should indicate they have a method in their override classes that match the button name. So if you know the button name you should be able to call the method from the correct class. However, whether that method is at the UI or Bus level needs to be determined,  if at the UI level, you can't easily accomplish this from the VI perform logic. Ideally, you can write a well written email to Vertex describing what you are trying to do and hope they respond with the method name, class, and arguments to the method.