In my Unified Service Desk (USD) interface I have toolbar button on the navigation toolbar of account that will show the website of an account. Problem was not all the account have a website defined.
So I enhanced the button to either show the accounts website or if not known to conduct a google search on the accounts name.
In my action to navigate to the website of the account I changed the url to be “url=[[$Scriptlet.AccountWebSite]]”, I then created a scriptlet called “AccountWebSite”.
My scriptlet looked like this, pretty simple really. It simply constructs a url to search google for the account name or returns the actual url of the accounts website.
I hope you find this simple change useful.
function AccountWebSite () { var accountWebSite = "[[account.websiteurl]+u]"; var url; if(accountWebSite == "" || accountWebSite == null) { url= "https://www.google.co.uk/?gws_rd=ssl#q=" + "[[account.name]+]"; } else { url = accountWebSite; } return url; } AccountWebSite();
Leave a comment