Skip to content

Instantly share code, notes, and snippets.

@mshanemc
Last active August 29, 2015 14:21
Show Gist options
  • Save mshanemc/631471420a1ae3ff8ecb to your computer and use it in GitHub Desktop.
Save mshanemc/631471420a1ae3ff8ecb to your computer and use it in GitHub Desktop.
Salesforce Universal Navigation in Angular
//universal navigation that works in SF1 or in web desktop UI
$scope.navigate = function(recordId){
if (typeof sforce !== 'undefined'){
sforce.one.navigateToSObject(recordId);
} else {
window.open("/" + recordId,'_blank'); //open in a new window
//window.location.href= "/" + recordId; //open in existing window
//window.top.location.href= "/" + recordId; //open in existing window from inside an iframe, like inline VF or VF in chatter action
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment