Sage 100

 View Only
  • 1.  BOI Delete SO Line With Keep Deleted History and prompt turned on

    Posted 08-05-2020 17:26
    We have a client that turned on the option to keep deleted sales order lines in history with the "prompt" option.  We have code in place that updates sales orders based on "forecasts" provided by their customer thru BOI.  We open the sales order, delete the lines on it, and then add the new lines in.  With this option turned on our code stopped working properly, not surprising, but what we found was we had to switch from .nDelete() to .nDeteleLine() to get passed the prompt.  The issue here though is we have to then save the sales order object, reopen it, and then we can do a nAddLine.  We can't seem to find a way to answer the prompt during the delete function in BOI so we don't have to use nDeleteLine().

    Is there a way in scripting/boi to answer the delete prompt on the lines?

    Thanks!

    ------------------------------
    Chris Mengerink
    Director
    DWD Technology Group
    Fort Wayne IN
    260-399-8653
    ------------------------------


  • 2.  RE: BOI Delete SO Line With Keep Deleted History and prompt turned on

    Posted 08-06-2020 02:54
    Hmm I'm surprised you had to switch from nDelete(). Are you actually seeing the prompt UI itself appear? Also, are you running the BOI while the S/O Entry UI is open for the order you are updating or open on another order? 

    For nDeleteLine this is how I would foresee doing it where you get the EditKey first and pass that into the nDeleteLine().
    (Using VBScript, ABC company, oSO for Header, oLines for the Lines)

    LineKey = "" : EditKey = ""
    retVal = oSO.oLines.nGetValue("LineKey$", LineKey)
    EditKey = oSO.oLines.sGetEditKey(LineKey) 'returns concatenated OrderNo + LineSeqNo + LineKey
    rtnDel = oSO.oLines.nDeleteLine(EditKey)
    If rtnDel Then 

    retVal = oSO.oLines.nAddLine()
    retVal = oSO.oLines.nSetValue("ItemCode$", "6655")
    retVal = oSO.oLines.nSetValue("QuantityOrdered", 2)
    retVal = oSO.oLines.nWrite()
    End If

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

    Accounting Systems, Inc. (ASI)
    Email: alnoor@asifocus.com
    Orange County, CA
    ------------------------------