Here is what we have done to help clients. We created a button on Invoice History Inquiry that the user can click on and track the first package it finds. It can handle UPS, FEDEX, USPS. It's not perfected yet but we have a couple of clients doing testing, hope this helps someone else at least get going.

Then made it run on client and pass in information

Invoice = AR_InvoiceHistoryInquiry_bus_InvoiceNo
HeaderSeq = AR_InvoiceHistoryInquiry_bus_HeaderSeqNo
Set objConn = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
sCompanyCode = ""
sCompanyCode = oSession.CompanyCode
objConn.ConnectionString = "DSN=SOTAMAS90; UID=putyourloginusernamehereforsage100; PWD=putyourpasswordhereforsage100; Company=" + sCompanyCode
objConn.Open ConnectionString
strSQL = "SELECT * FROM AR_InvoiceHistoryTracking WHERE InvoiceNo = '" & Invoice & "' AND HeaderSeqNo = '" & HeaderSeq & "'"
objRS.Open strSQL, objConn
CurrentTracking = ""
IF objRS.EOF = FALSE Then
CurrentTracking = objRS.fields.Item("TrackingID").value
END IF
Set UPSA = New RegExp
With UPSA
.Pattern = "^(1Z)[0-9A-Z]{16}$"
.IgnoreCase = False
.Global = False
End With
Set UPSB = New RegExp
With UPSB
.Pattern = "^(T)+[0-9A-Z]{10}$"
.IgnoreCase = False
.Global = False
End With
Set UPSC = New RegExp
With UPSC
.Pattern = "^[0-9]{9}$"
.IgnoreCase = False
.Global = False
End With
Set UPSD = New RegExp
With UPSD
.Pattern = "^[0-9]{26}$"
.IgnoreCase = False
.Global = False
End With
Set USPSA = New RegExp
With USPSA
.Pattern = "^(94|93|92|94|95)[0-9]{20}$"
.IgnoreCase = False
.Global = False
End With
Set USPSB = New RegExp
With USPSB
.Pattern = "^(94|93|92|94|95)[0-9]{22}$"
.IgnoreCase = False
.Global = False
End With
Set USPSC = New RegExp
With USPSC
.Pattern = "^(70|14|23|03)[0-9]{14}$"
.IgnoreCase = False
.Global = False
End With
Set USPSD = New RegExp
With USPSD
.Pattern = "^(M0|82)[0-9]{8}$"
.IgnoreCase = False
.Global = False
End With
Set USPSE = New RegExp
With USPSE
.Pattern = "^([A-Z]{2})[0-9]{9}([A-Z]{2})$"
.IgnoreCase = False
.Global = False
End With
Set FedA = New RegExp
With FedA
.Pattern = "^[0-9]{20}$"
.IgnoreCase = False
.Global = False
End With
Set FedB = New RegExp
With FedB
.Pattern = "^[0-9]{15}$"
.IgnoreCase = False
.Global = False
End With
Set FedC = New RegExp
With FedC
.Pattern = "^[0-9]{12}$"
.IgnoreCase = False
.Global = False
End With
Set FedD = New RegExp
With FedD
.Pattern = "^[0-9]{22}$"
.IgnoreCase = False
.Global = False
End With
Link = ""
' Test method returns TRUE if a match is found
If UPSA.Test( CurrentTracking ) OR UPSB.Test( CurrentTracking ) OR UPSC.Test( CurrentTracking ) OR UPSD.Test( CurrentTracking ) Then
'MsgBox(CurrentTracking & " is a valid UPS Tracking #")
Link = "https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=" & CurrentTracking
Else
'MsgBox(CurrentTracking & " is NOT a valid UPS Tracking #")
If USPSA.Test( CurrentTracking ) OR USPSB.Test( CurrentTracking ) OR USPSC.Test( CurrentTracking ) OR USPSD.Test( CurrentTracking ) OR USPSE.Test( CurrentTracking ) Then
'MsgBox(CurrentTracking & " is a valid USPS Tracking #")
Link = "https://tools.usps.com/go/TrackConfirmAction?tRef=fullpage&tLc=2&text28777=&tLabels=" & CurrentTracking
Else
'MsgBox(CurrentTracking & " is NOT a valid USPS Tracking #")
If FedA.Test( CurrentTracking ) OR FedB.Test( CurrentTracking ) OR FedC.Test( CurrentTracking ) OR FedD.Test( CurrentTracking ) Then
'MsgBox(CurrentTracking & " is a valid FedEx Tracking #")
Link = "https://www.fedex.com/fedextrack/?trknbr=" & CurrentTracking
Else
'MsgBox(CurrentTracking & " is NOT a valid FedEx Tracking #")
MsgBox(CurrentTracking & " is NOT a valid FedEx/UPS/USPS Tracking #")
End If
End If
End If
IF Link <> "" THEN
CreateObject("WScript.Shell").Run(Link)
END IF
------------------------------
Chris Mengerink
Director
DWD Technology Group
------------------------------