Can you trigger a script to open Customer Inquiry when clicking on Totals tab in SO Invoice Data Entry?

SOLVED

I am not well versed in scripting, but I know it can do a lot of wonderful things.  I'm hoping this will be possible.

I have a customer that creates credit memos but they do not always apply them.  They would like a way to checking their customer's invoices at the time they are doing invoices.

I was thinking there might be a way of triggering the Customer Inquiry screen (opened to the Invoices tab for the customer being invoiced) when you go to the Totals tab in SO Invoice Data entry, sort of the way it works when you click on the Customer button from Invoice Data entry.

If it can't be done when going to the totals tab, maybe I can create a button that would trigger it?
Is it possible? 

  • 0

    I'd do a script to query AR_OpenInvoice then pop-up a text list of open invoices with a balance (which would show CM too).  No open balances, no pop-up... and less intrusive than always opening Customer Inquiry.

  • 0 in reply to Kevin M

    Hi Kevin,

    That would be a great solution.  I assume I could only query invoices with a balance (<>0), which should give me both CMs and regular invoices (just not paid invoices).

    Can you point me in the way of how to go about running a query on AR_OpenInvoice using vb?  I've searched on the commands but not sure which one to use exactly.  Any help would be greatly appreciated.

  • 0

    Any reason why you can't click on the Customer No hyperlink on the header tab?  Unlike the Customer button, the hyperlink will show you the invoices tab.

  • 0 in reply to TomTarget

    Great point!  However, I tried to explain this already but "it's an extra step".  This customer is coming from Peachtree where you get prompted to apply credit memos at the time of invoicing.  Unfortunately, they are a bit set in their ways so I was trying to find something for them that's similar.  

  • 0 in reply to Javier Guzman
    SUGGESTED

    Easiest way is to set up a PreTotals script (filtered to SO Invoice Entry) to invoke the pHeader button, then that CustomerNo button.  If you've never scripted in Sage 100 before, writing a query as I mentioned above is probably not a good place to start.

  • 0 in reply to Kevin M

    Excellent, that's where I'm headed now.  Thank you so much Kevin and Tom!  I really appreciate your input.

  • 0 in reply to Kevin M

    Excellent idea Kevin!   One thing I like about this forum is that putting heads together yields lots of good ideas.   So easy to get stuck on one thought process and not think about others.

  • 0 in reply to Kevin M

    Kevin,

    I tried to do the script (which seems simple enough).  However, the CustomerNo button (opening Customer Maintenance) never fires.  Would you know what I'm missing?  This is the script:

    retVal=0

    retVal = oScript.InvokeButton("fldr.pHeader")
    Set oUIObj = oSession.AsObject(oScript.UIObj)
    retVal = oScript.InvokeButton("BT_ML_CUSTOMERNO")
    retVal = oUIObj.HandleScriptUI()
    retVal = oScript.InvokeButton("fldr.pTotals")

    Many thanks in advance,

    Javier

  • 0 in reply to Kevin M

    Ok, I figured it out (almost completely).  Probably not the prettiest, but it works for now.  Sharing in case anyone may need it or something similar.

    oARCust = 0
    DivNo = 0
    CustNo = ""
    CustNumber = ""

    oARCust = oSession.GetObject("AR_Customer_UI")
    retVal = oBusObj.GetValue("ARDivisionNo$",DivNo)
    retVal = oBusObj.GetValue("CustomerNo$",CustNo)
    CustNo = Cstr(CustNo)

    If DivNo < 10 then
    DivNo = "0" & DivNo
    else
    DivNo
    End if

    CustNumber = DivNo&CustNo

    if oARCust <> 0 then
    Set oARCust = oSession.AsObject(oARCust)
    retVal = oARCust.Process(CustNumber)
    retVal = oScript.InvokeButton("AR_Customer.pInvoice")
    End if

    Now, a follow-up question: If you notice, at the end I have a line to invoke the pInvoice tab on the Customer Maintenance window.  Unfortunately, it doesn't get there - it only opens Customer Maintenance on the main tab.  Any way to force it to go to the Invoice tab?  I'm sure I'm just missing a small piece.  Any help would be greatly appreciated.