Sage 100

 View Only
  • 1.  After Premium upgrade, AR CRE "Panel - OnExit" script completes then triggers Error 20

    Posted 03-03-2021 15:17
    Edited by Dan Burleson 03-03-2021 16:07
    This script worked in Sage 100 Adv, but with Premium and no change, it completes SUCCESSFULLY then we get the "Error 20 (Syntax error) in Method HandleScriptUI Statement 1872" AFTER the last line of the PLINES "Panel - OnExit" UI script. Ideas anyone?

    The script adds a line to the receipt lines. All functions return retVal = 1. All diagnostic messages show normal operation and exit through last line of script (which is a DebugPrint showing retVals = 1).

    Relevant code (works if removed);

    			    nAmountPosted = (CC_FEE/100) * nTotal_Fee_able
    				retVal1 = oLines.AddLine()
    				retVal2 = oLines.SetValue("LineType$", "G")
    				retVal4 = oLines.SetValue("AccountKey$", sSY_CC_FEE_ACCT_KEY)
    				retVal5 = oLines.SetValue("AmountPosted", Round(nAmountPosted,2))
    				
    				retVal6 = oLines.Write()
    				
    				oScript.LinesAdded = 1


    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-224-6642
    ------------------------------


  • 2.  RE: After Premium upgrade, AR CRE "Panel - OnExit" script completes then triggers Error 20
    Best Answer

    Posted 03-03-2021 16:16
    Edited by Dan Burleson 03-03-2021 17:35
    Random thoughts:
    The general purpose of oScript.LinesAdded is for a pending grid refresh. Is your purpose the same? Interesting that it runs on a Panel OnExit event so I guess grid refresh is not your purpose. In short if you don't need it then get rid of it.

    Also, if you hit the X in the top right, that should trigger DMain On_Exit if you have it defined. But it may also run Panel_OnExit (not sure about that) which you may not be expecting, in case you are closing down the screen instead of moving panel to panel.

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

    Email: alnoor@asifocus.com
    Ph: 949-689-9887
    Orange County, CA
    ------------------------------



  • 3.  RE: After Premium upgrade, AR CRE "Panel - OnExit" script completes then triggers Error 20

    Posted 03-03-2021 17:38
    Ding ding ding ding! Superfluous is as superfluous does. Removing the superfluous oScript.LinesAdded allowed the Premium version to work!

    Thank you Alnoor!

    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-224-6642
    ------------------------------