Skip to content

Instantly share code, notes, and snippets.

@AdityaPavanVempati
Last active March 10, 2016 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdityaPavanVempati/d4cf86fc53697f982d5a to your computer and use it in GitHub Desktop.
Save AdityaPavanVempati/d4cf86fc53697f982d5a to your computer and use it in GitHub Desktop.
While clicking the button an Apex ( googleUrlShortener ) class should come and perform the operation
Behavior Execute JavaScript
onClickJavaScript:
{!REQUIRESCRIPT( "/soap/ajax/35.0/connection.js" )}
{!REQUIRESCRIPT( "/soap/ajax/35.0/apex.js" )}
var obj = {
"longURL" :"{!Bookmark__c.URL__c}",
"bookmarkId" :"{!Bookmark__c.Id}",
};
sforce.apex.execute( "GoogleUrlShortener", "shortenURL", obj );
location.reload();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment