Page 1 of 1

Track a UPS number

Posted: 12 Jul 2016, 07:39
by WayneP
So, if I had a field on my IBMi screen that was a UPS tracking number, is there a way to program aXes, so that clicking on it, would open another window (the UPS website) and pass the tracking information and have it displayed?

Re: Track a UPS number

Posted: 12 Jul 2016, 15:24
by jeanmichel
Hi Wayne,

This is definitely possible. However I do not know the specifics of the UPS website and whether you can query if via the URL. You will have to find this out. I will take the example of searching for a specific query in Google. I will try and give you a step by step introduction on how to do this.

1) The first step is to name your field in the axes designer. WE are going to use the command line on the main menu fort his example.
So open the aXes development environment and name the command line to "commandline". (in the Screens Tab)

2) add a push button extension onto the screen.
Set it's on click even to the following script:

Code: Select all

// Find the field called "commandline"
var cmdline = FIELDS("commandline");

// Extract the value present in the input
var cmd = cmdline.getValue();

// Use the value of the field to concatenate with the URL from google to create the search criteria.
var url = "https://www.google.com.au/search?q=" + cmd;

// Open a new tab showing the URL
window.open(url,"_blank");
3) So now perhaps a similar code can be used to query the UPS tracking number.

Hope this helps.

Re: Track a UPS number

Posted: 20 Jul 2016, 01:58
by WayneP
Jean-Michel,
Awesome this worked great !!!

for future reference, to get to the UPS web site for tracking here's the URL:
http://wwwapps.ups.com/WebTracking/trac ... XXXXXXXXXX

Is there a way to paste into the script editor? Is there a way to make the font and edit box bigger?