Friday, June 25, 2010

Google Maps

What a mash!

Many of the comments on one of the more popular posts (Google Maps in Siebel CRM) on this blog and e-mails I received from readers are around the question:

How can we show multiple addresses in Google Maps?

There are two answers:

First, there is the Google Maps API, which allows you to do (almost) anything you want by using the documented JavaScript functions. However, implementing an embedded map in the Siebel CRM Web Client using the JavaScript API is still a challenge and requires a lot of (browser) scripting. If anyone has gone that far, please let us know.

The second answer - and subject of this post - is of much lower effort (it's scriptless). Of course we can not expect the full glory of interactive maps but maybe the following example holds something for you. At least you'll see how to use Multi-Value Fields with Symbolic URLs.

Besides the JavaScript API, Google has published a URL-based API for static maps. The only thing we have to do is generate a URL similar to the following (line breaks added for better readability):

http://maps.google.com/maps/api/staticmap?
size=650x350&
maptype=roadmap&
markers=Niagara+Falls&
markers=Vienna,Austria&
sensor=false

Click here to see the result of the URL (which is slightly modified from the above to impress you ;-)

The Google server returns a PNG graphic.

The parameters such as size, zoom, maptype and sensor are nicely explained (along with many other options) on the documentation page of the Google Static Maps API. What is of special interest for our requirement of showing multiple account locations is the markersparameter which obviously can be repeated multiple times and produces one marker icon per address.

The markers parameter takes at minimum an address string but can also take other input strings such as the icon graphic, the marker color and a (single character) label text.

How to use the Google Static Maps API with Symbolic URLs

The URL above has been generated by the Siebel Portal Framework. Similar to the well-known example of integrating the dynamic Google maps - which sadly support only a single address - we have to create a Symbolic URL as follows:

URL: http://maps.google.com/maps/api/staticmap
Fixup Name: Default
Multivalue Treatment: Separate Arguments

The Multivalue Treatment parameter is the key to success. When we specify Separate Arguments, then the Portal Framework will repeat the argument for each value of the multi-value field associated with the parameter.

Let's look at the arguments list for the Symbolic String (click to enlarge):

The hot record is the markers argument which takes the name of a (new) multi-value field which concatenates the city, state, zip code and country of an address to a comma-separated string.

The rest of the parameters is similar to our previous example on Google Maps integration. Please refer to this example also for details on how to create the applet etc.

As a result, a static image is returned with one marker for each address of the account.

Summary

With the Google Static Maps API it is possible to embed an image-based Google map in Siebel CRM showing all address locations for the selected account. The Siebel Portal Framework supports the generation of the same URL parameter for each value of a multi-value field, providing a low-effort solution.

Have a nice map

@lex

Saturday, June 19, 2010

Framework

nths (may be an year) back if somebody would have asked me about frameworksand Siebel. Then my answer would have been, “Framework and Siebel are two separate things and don’t go together”.

A comment by “Tiziano and Paolo” changed all that. It started right here, an innocent comment on eScript best practices post published on Siebel unleashed opened the Pandora’s box and introduced us to the world of framework in Siebel. We go to know that a framework called ABS exists and it potentially changes the way we write eScript.

Jason took it to next level by actually confirming the existence of framework and introducing the features of this framework. ABS was bound by IP laws so nothing could be shared technically but it was still an eye opener and a treat to read. Recently Mik picked up the framework baton and started by sharing couple of very useful functions. Then he shared anerror logging framework with some utility function that he he had developed on a T eScript engine. It looked great but sadly, it didn’t work in ST engine.

A discussion about Pro’s and Con’s of various approaches to create framework on Linked In group resulted in opening of more avenues and techniques to lay a foundation of frameworks. Siebel veterans Matt and Andres discussed alternates to method chaining and prototyping and various techniques they had used to create there frameworks.

Finally Matt has given us a full fledged framework working on ST Engine (should work on T with few minor modifications). His framework helps in reducing the amount of code you have to write in Application. Just to show an example:

  • Run a business service:
ar bIsValid = oFramework .Service.run("PTSB VCA System Process Service.ValidatePpsn", ["Ppsn"], ["4576554F"]).IsValid

Query a Business Component:

var sFullName = oFramework.BusComp.getRecord("Employee.Employee", TheApplication().LoginId(), ["Full Name"])["Full Name"];

I am going to give it a try very soon and will share my experience. The big question is what other benefits does it have apart from code reduction?? Does it help in improve performance and memory utilization??

Only time will tell…

Related Posts