Sage 100

 View Only
Expand all | Collapse all

Can you fire a script from an Order Print button to execute before printing?

  • 1.  Can you fire a script from an Order Print button to execute before printing?

    Posted 08-24-2022 10:56
    Can you fire a script from an Order Print button to execute before printing?


    ------------------------------
    Lee Graham
    Friendly Systems, Inc.
    ------------------------------


  • 2.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 08-24-2022 10:59
    Replace the Sage button with your own (putting it on top of the Sage button), run your script, then invoke the Sage button when done.

    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    ------------------------------



  • 3.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 08-24-2022 11:30
    So...
    ... my script...?????? then:

    retVal = oScript.InvokeButton("BT_Print")

    Thanks,
    Lee
    --

    Friendly Systems, Inc.

    Sage 100 (Mas90/200), Sage 300 (Accpac), SageCRM, xTupleERP
    Visit us on the web at www.friendlysystems.com
    Office:?? 678.273.4010 ext 4
    Mobile: 404.202.9065
    Fax:?????????? ??678.273.4012
    See our blog at www.friendlysystems.com/blog


    Virus-free.www.avg.com





  • 4.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 08-24-2022 12:13
    Yes, correcting for whatever the Sage button is called on the panel.

    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    ------------------------------



  • 5.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 10:53
    Thanks,
    My script needs to call another script (both on server).  Do you know the syntax for that?

    ------------------------------
    Lee Graham
    Friendly Systems, Inc.
    ------------------------------



  • 6.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:01
    What kind of "other script"?  BOI?

    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    ------------------------------



  • 7.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:14
    No, just another customizer script on server.

    Lee
    --

    Friendly Systems, Inc.

    Sage 100 (Mas90/200), Sage 300 (Accpac), SageCRM, xTupleERP
    Visit us on the web at www.friendlysystems.com
    Office:?? 678.273.4010 ext 4
    Mobile: 404.202.9065
    Fax:?????????? ??678.273.4012
    See our blog at www.friendlysystems.com/blog


    Virus-free.www.avg.com





  • 8.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:21
    Set your second script up as a button, running on the server, and invoke it.  If you want to hide the button, there are examples of how to do that (something like show, invoke, hide...) in a few places.
    Or set up a BOI event on something (checkbox post validate) and update that field in your first script to trigger the second script.

    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    ------------------------------



  • 9.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:29
    Kevin,
    ?????? I want one button to invoke 2 scripts one-after-the other.?? I don't know that syntax to invoke a script from within another script
    (other than Alnor's client-script example)
    Again, both scripts operate on the server.

    I need to invoke the 2nd script at the beginning of the 1st script.?? Would it automatically wait or does that require a WAIT clause to wait for that before proceeding.


    Thanks,
    Lee
    --

    Friendly Systems, Inc.

    Sage 100 (Mas90/200), Sage 300 (Accpac), SageCRM, xTupleERP
    Visit us on the web at www.friendlysystems.com
    Office:?? 678.273.4010 ext 4
    Mobile: 404.202.9065
    Fax:?????????? ??678.273.4012
    See our blog at www.friendlysystems.com/blog


    Virus-free.www.avg.com





  • 10.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:38
    Why not combine the two scripts into one?  Button scripts can have subroutines, so set up the second script as being something you call inline... regular VBScript stuff.

    Call ButtonScript()
    ...

    ...

    Sub ButtonScript()

    ' script code… now possibly including an "exit sub" command

    End sub ' ButtonScript



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    ------------------------------



  • 11.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:43
    Ok I see, just use the oScript.InvokeButton(BT_Button) to invoke the 2nd script.

    Thanks

    ------------------------------
    Lee Graham
    Friendly Systems, Inc.
    ------------------------------



  • 12.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:45
    Yes, but I don't know whether the first script will "wait" until the second script is done before continuing execution.  Be sure to test.

    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    ------------------------------



  • 13.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 09-22-2022 11:47
    Seems like consecutive commands would WAIT for previous step to complete.
    Will test.
    Thanks,
    Lee
    --

    Friendly Systems, Inc.

    Sage 100 (Mas90/200), Sage 300 (Accpac), SageCRM, xTupleERP
    Visit us on the web at www.friendlysystems.com
    Office:?? 678.273.4010 ext 4
    Mobile: 404.202.9065
    Fax:?????????? ??678.273.4012
    See our blog at www.friendlysystems.com/blog


    Virus-free.www.avg.com





  • 14.  RE: Can you fire a script from an Order Print button to execute before printing?

    Posted 10-20-2022 09:12
    Both scripts work individually, but invoking them consecutively in another script causes problems in the sales order and added paya charges.
    The first script is long, writes to the order line file.  The 2nd script prints the order.  Both scripts on server.
    Seems like some kind of WAIT clause after invoking the first script might solve this.  Anyone know of a scripting clause for WAITING.
    The script is simply:
    retVal = oScript.InvokeButton("BT_Link6") ' which gets order line UDF's from another system and writes to order.
    retVal = oScript.InvokeButton("BT_Print")

    ------------------------------
    Lee Graham
    Friendly Systems, Inc.
    ------------------------------