Tracking Details Button Alternative

I have seen this pop up before, but did not find a solution:

Clicking our Tracking Details button results in the Epicor web browser launching with a
Script Error 0: Expected “,”

The tracking URL for Fedex I use is:
FedEx | System Down&cntry_code=us

The error displays the URL formulated as:
FedEx | System Down<787013324934>&cntry_code=us

This errors out on the Fedex site due to the brackets surrounding the tracking number. I found that I can omit the brackets in the Tracking URL setup, and now the URL gets formulated as:
https://www.fedex.com/fedextrack/?action=track&tracknumbers=787013324934&cntry_code=us

The Fedex site returns valid shipment info with that URL. I still get the error though, so the issue must be with the internal browser not getting the right information and the suggested fix is moving to 10.2.xxx. That will happen later this year for us.

Just wondering if someone has fixed this issue by adding a new button that uses the captured and opens the URL with a regular browser? Or maybe has it as a clickable link that bypasses the internal browser or something?

Thanks!

Paul

@psiebers I did this for 5 forms last month, so it is not hard as I rarely do customizations. This not my code originally, but I have used it since the E9 days and it works for this by using the default browser. I did the Misc Shipment Tracker now to document the steps I followed.

Form Event Wizard - Add EpiviewNotification on the view that has the tracking number.

Add button named btnTrack (make it the same size and location after testing of the original button)

use wizard - Reference Adaptor to add ShipViaAdaptor

script F5 to compile

save

close form - open form to get button available

Event wizard

epiButton - Your button - Click - Add.

paste in the btnTrack_Click routine.

edit data views to the ones added earlier for this form

edit shipvia adaptor to current form name

private static void btnTrack_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		System.Data.DataRow edvShipHeadRow = edvShipHead.CurrentDataRow; 
			if ((edvShipHeadRow != null) && !string.IsNullOrEmpty(edvShipHeadRow["TrackingNumber"].ToString()))
			{
					//MessageBox.Show(edvShipHeadRow["TrackingNumber"].ToString());

		
						var x = new ShipViaAdapter(CustShipForm);
		        oTrans.PushStatusText(string.Format("3 "), false);
		        x.BOConnect();
		        oTrans.PushStatusText(string.Format("4 "), false);
		
		
		        // MessageBox.Show("ShipViaCode " & sh.MiscShipData.Tables("MscShpHd").Rows(0)("ShipViaCode"))
		
		        if (!x.GetByID(edvShipHeadRow["ShipViaCode"].ToString().Trim()))
		        {
		            MessageBox.Show("No ShipVia Record Found!");
		        }
			
		        oTrans.PushStatusText(string.Format("6 "), false);
		        string url = (string)x.ShipViaData.Tables["ShipVia"].Rows[0]["TrackingURL"];
		        oTrans.PushStatusText(string.Format("7 "), false);
						string placeholder = (string)x.ShipViaData.Tables["ShiPVia"].Rows[0]["TrackingNumPlaceHolder"];
						string tracking = (edvShipHeadRow["TrackingNumber"].ToString());
		        url = url.Replace(placeholder, tracking);
		
		//		MessageBox.Show(url);
		
		        oTrans.PushStatusText(string.Format("8 "), false);
		        Process.Start(url);
				
		
		
		        oTrans.PushStatusText(string.Format("9 "), false);
		        x.Dispose();
		        oTrans.PushStatusText(string.Format("10"), false);
		        x = null;
		        oTrans.PushStatusText(string.Format("11"), false);
		       

			}


	}
2 Likes