Tutorial: Lesson: Five Contact App Passing data values to the default browser


Hello everyone.

Today we are going to discuss how to supercharge your Contact application by including Web Interface. We will discuss how to pass data values stored in a local table to the users default browser performing search’s and queries. For this example, we use Google maps to show how it works.

On our original Contact  application, there is a button labeled Open Map When clicked the action script attached to the button opens a popup form with an activeX object supercontrol which displays a HTML page of Google Maps with the map queried on the contacts address.

This works fine if you are creating the app for your personal use, but if you intend to distribute the app when done, you will need to register the activeX object on each users machine. (Procedures can be found on Alpha’s Wiki site). What we will do instead, is pass the values to Google maps using the default browser of the user. How is that possible you say. Well the trick is in an Alpha Software internal function called

sys_open()

Sys_Open() opens any file based on the association of that file recorded in windows. A web address starts with Http. This tell Windows to open a web browser and it uses the browser the end user has set as the default.

The information we need to send to Google is the address of the contact which is stored in People.tbl.  Since People is the parent of the activity set, we can use table.current when referencing the fields in the code.

t = table.current()
addr = “http://maps.google.com/maps?q=”+alltrim(t.Address_1)+” “+Alltrim(t.Address_2)+” “+Alltrim(t.City)+” “+Alltrim(t.Region)+” “+t.Zip+” ”
sys_open(addr)

Here is how it looks when this code is used.

My default browser is Firefox (No endorsement intended), so now the map is displayed in my Firefox browser and I have the ability to do much more with the information then just look at a map.

To see how this is done and a short overview of form design, watch our short how to video.

Sit back relax and enjoy.

Let us know if this video is useful and you can view all of our how to video’s at:

http://www.youtube.com/user/cdcTakeCharge


Comments

2 responses to “Tutorial: Lesson: Five Contact App Passing data values to the default browser”

  1. Greate article. Keep posting such kind of info on your page.
    Im really impressed by it.
    Hello there, You’ve performed a great job. I’ll certainly digg it
    and for my part recommend to my friends. I’m confident they will be benefited from this web site.

    Like

    1. Thanks, Glad you liked it and much more is to come.

      Like

Leave a reply to .pst viewer Cancel reply