Sage 100

 View Only
  • 1.  Display of Vendor Remit to Address using Custom Office

    Posted 04-30-2026 11:34

    Is there a way with custom office to display the Vendor's Remit to Address while in AP Invoice Data Entry.  The end user knows they can use the hyperlink to the vendor and look up the info there, but it would be more efficient for them to see the Remit to Address so they can verify it.  They just want the information displayed - so that if they need to make a change they are ok with clicking the hyperlink to Vendor Maintenance and changing the remit to address from there.  I've already added the display of the vendor's address fields (again, so that they can verify when entering AP invoices).  The Vendor Remit To is not in the list of tasks to assign to a button (but note that Vendor Contacts are and that is not a menu task), and I don't have the fields available from the AP_VendorRemit file to add to the screen either.  

    Seems like the Vendor Remit Address is kind of an orphan.  There are a couple of ideas out there on the Ideas Site that I've voted for.  



    ------------------------------
    Jane Scanlan
    Partner
    Next Level Manufacturing Consulting Group
    ------------------------------


  • 2.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 04-30-2026 12:39

    What about BO scripting to write the information to an AP invoice Header UDF.  Might require a genius scripter ( @David Speck II @Alnoor Cassim @Dan Burleson ) come to mind.  There are certainly others up to the task.



    ------------------------------
    Jeff Schwenk
    Owner
    Bottomline Software, Inc.
    Waynesboro VA
    (540) 221-4444

    Improving bottom lines for over 25 years!
    ------------------------------



  • 3.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 04-30-2026 13:13

    I was trying to avoid scripting @Jeff Schwenk ... because this one would be above my pay grade.  They'll have to live without this handy info, for now.



    ------------------------------
    Jane Scanlan
    Partner
    Next Level Manufacturing Consulting Group
    ------------------------------



  • 4.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 04-30-2026 13:16

    But, there's ChatGPT to get me started ... I just asked it to write me a script and it's pretty impressive what it came up with.  



    ------------------------------
    Jane Scanlan
    Partner
    Next Level Manufacturing Consulting Group
    ------------------------------



  • 5.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 04-30-2026 14:09

    A button script could open the vendor remit record, read the fields you want to display, then pop-up a messagebox with the values (as a block of text).  Not too complicated at all (as long as the user has permission to open the AP_VendorRemit_bus object).



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



  • 6.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 05-01-2026 09:12

    That's what I'm going to try to do @Kevin Moyes.



    ------------------------------
    Jane Scanlan
    Partner
    Next Level Manufacturing Consulting Group
    ------------------------------



  • 7.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 05-03-2026 02:24
    Edited by Dan Burleson 05-04-2026 01:14

    I put this to ChatGPT and we both made a small mistake. ChatGPT initially went with my assertion of the existence of a read-only AP_VendorRemit object, but in fact only the read-write object (AP_VendorRemit_bus) is available. ChatGPT's mistake was to reference the MessageBox incorrectly as oScript.UIObj.MessageBox(...) instead of the correct oSession.AsObject(oSession.UI).MessageBox(...). Aside from these two minor issues, the solution was accurate. The script below and sample message box reflects those corrections.

    My prompt to ChatGPT:

    "Write a Sage 100 button script that would be triggered on the AP Invoice Data Entry header panel and link to the AP_VendorRemit business object in read-only mode and retrieve the Vendor RemitToAddressLine1, RemitToAddressLine2, RemitToAddressLine3, RemitToCity, RemitToState, RemitToZipCode, and RemitToCountryCode displaying them with a MessageBox function."

    ' AP Invoice Data Entry Header Button Script
    ' Retrieve Vendor Remit-To address from AP_VendorRemit in read-write mode
    
    Dim sAPDivisionNo
    Dim sVendorNo
    Dim sRemitToCode
    Dim oVendorRemit
    Dim sAddr1, sAddr2, sAddr3
    Dim sCity, sState, sZip, sCountry
    Dim sMsg
    Dim retVal
    
    sAPDivisionNo = ""
    sVendorNo = ""
    sRemitToCode = ""
    
    retVal = oBusObj.GetValue("APDivisionNo$", sAPDivisionNo)
    retVal = oBusObj.GetValue("VendorNo$", sVendorNo)
    retVal = oBusObj.GetValue("RemitToCode$", sRemitToCode)
    
    If Trim(sVendorNo) = "" Then
        retVal = oSession.AsObject(oSession.UI).MessageBox("", "No vendor is currently selected.")
        oScript.DeactivateProcedure
    End If
    
    ' Use the service object for read-write access
    Set oVendorRemit = oSession.AsObject(oSession.GetObject("AP_VendorRemit_bus"))
    
    ' AP_VendorRemit key is normally:
    ' APDivisionNo + VendorNo + RemitToCode
    retVal = oVendorRemit.SetKey(sAPDivisionNo & sVendorNo & sRemitToCode)
    
    If retVal = 0 Then
        sMsg = "Vendor remit-to record was not found." & vbCrLf & vbCrLf & _
               "AP Division: " & sAPDivisionNo & vbCrLf & _
               "Vendor No: " & sVendorNo & vbCrLf & _
               "Remit-To Code: " & sRemitToCode
    
        retVal = oSession.AsObject(oSession.UI).MessageBox("", sMsg)
        oScript.DeactivateProcedure
    End If
    
    sAddr1 = ""
    sAddr2 = ""
    sAddr3 = ""
    sCity = ""
    sState = ""
    sZip = ""
    sCountry = ""
    
    retVal = oVendorRemit.GetValue("RemitToAddressLine1$", sAddr1)
    retVal = oVendorRemit.GetValue("RemitToAddressLine2$", sAddr2)
    retVal = oVendorRemit.GetValue("RemitToAddressLine3$", sAddr3)
    retVal = oVendorRemit.GetValue("RemitToCity$", sCity)
    retVal = oVendorRemit.GetValue("RemitToState$", sState)
    retVal = oVendorRemit.GetValue("RemitToZipCode$", sZip)
    retVal = oVendorRemit.GetValue("RemitToCountryCode$", sCountry)
    
    sMsg = "Vendor Remit-To Address" & vbCrLf & vbCrLf & _
           sAddr1 & vbCrLf & _
           sAddr2 & vbCrLf & _
           sAddr3 & vbCrLf & _
           sCity & ", " & sState & "  " & sZip & vbCrLf & _
           sCountry
    
    retVal = oSession.AsObject(oSession.UI).MessageBox("", sMsg)
    
    Set oVendorRemit = Nothing



    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-829-1054
    ------------------------------



  • 8.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 05-05-2026 17:23

    Dan,

    This code looks impressive, but I don't know how you got this to work in Sage since there is no such thing as a Vendor Remit Code.  The key to the vendor remit file in Sage is vendor division + vendor code.  



    ------------------------------
    Jane Scanlan
    Partner
    Next Level Manufacturing Consulting Group
    ------------------------------



  • 9.  RE: Display of Vendor Remit to Address using Custom Office

    Posted 21 days ago

    Good catch. The script does give the correct information. Make that a 2nd AI mistake inconsequential as it is. My question becomes how does the GetValue("RemitToCode$", sRemitToCode) get a successful return code since, as you rightfully point out, it clearly doesn't exist. Since sRemitToCode is empty then appending it to the key has no effect thus addressing the AP_VendorRemit table succeeds.

    AI is helpful even though it makes stupid mistakes and now we know that verifying the results doesn't always find them all. 



    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-829-1054
    ------------------------------