Sage 100

 View Only
  • 1.  Disable script for VI Imports

    Posted 08-01-2022 15:12
    I have a script running during SO Entry, but the customer wants it to not fire for imports of sales orders. How do I disable the script for VI imports?

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    ------------------------------


  • 2.  RE: Disable script for VI Imports

    Posted 08-01-2022 15:26
    If Left(oSession.StartProgram,2) <> "VI" Then 'continue

    OR

    If Left(oSession.StartProgram,2) = "VI" Then Exit Sub 'will not work if re-using for a button script

    You call also evaluate an array of possible Start Program's, and then if true continue with rest of script. This is what I do.

    ------------------------------
    Alnoor Cassim

    Email: alnoor.cassim@90minds.com
    Ph:
    ------------------------------



  • 3.  RE: Disable script for VI Imports

    Posted 08-01-2022 15:40
    This is what I normally do. This in an INCLUDE array. It lets you put in multiple start programs. It excludes V/I too unless you comment out the Optional line.

    BadStart = 0
    StartPAllowed = Array(UCase("SO_SalesOrder_UI"),UCase("SO_531SORRepriceOrders_UI")) 'only these 2 can run rest of script
    StartPFilter = Filter(StartPAllowed, oSession.StartProgram)
    StartPOK = 0 : For Each x in StartPFilter : StartPOK = 1 : Next
    'Optional for allowing V/I instead of putting VIWIxx in Array: If Left(oSession.StartProgram,2) = "VI" Then StartPOK = 1
    r=oScript.DebugPrint("StartPOK from Filter = " & StartPOK)
    If StartPOK=0 Then BadStart=1

    If BadStart = 0 Then 'continue rest of script.

    ------------------------------
    Alnoor Cassim

    Email: alnoor.cassim@90minds.com
    Ph:
    ------------------------------



  • 4.  RE: Disable script for VI Imports

    Posted 08-01-2022 15:27
    If oSession.StartProgramName = "Sales Order Entry" Then
        *your-script-here*
    End If

    ------------------------------
    Steve Iwanowski, NextStep Technology Advisors, aka DSD Lancaster PA ¯\_(ツ)_/¯
    ------------------------------



  • 5.  RE: Disable script for VI Imports

    Posted 08-02-2022 10:35
    if oSession.ModuleCode <> "V/I" then
    ' do stuff
    end if


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



  • 6.  RE: Disable script for VI Imports

    Posted 08-02-2022 10:52
    I like @Kevin Moyes' script - "...do stuff" - I could do that!! ;)​

    ------------------------------
    Therese Logeais, Technology Integrators
    ------------------------------



  • 7.  RE: Disable script for VI Imports

    Posted 08-02-2022 11:28
    Thanks everyone!!

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    ------------------------------