Navigation on Salesforce App and Checking the Browsing Form Factor of Mobile App

This post is helpful for the below points ==>
1) If you want to do navigation on Salesforce App
2) If you want to confirm the Form Factor of the Browser
3) If you want to check the user is using Salesforce App or something else


On Salesforce App you can also navigate to the sObject record by using sforce.one.navigateToSObject(id)

Code:

function isSalesforce1() {
    return((typeof sforce != 'undefined') && sforce && (!!sforce.one));
}

if( isSalesforce1() ) {
     //code for salesforce app
    var app = component.get("v.applicationId");
    sforce.one.navigateToSObject(app);
}
else {
    // code for Community or Salesforce org
}




Resource:
https://developer.salesforce.com/forums/?id=906F0000000BYoHIAW
https://resources.docs.salesforce.com/sfdc/pdf/salesforce1_url_schemes.pdf



Hope this helps you...Enjoy..!

Comments

Popular posts from this blog

Salesforce Integration with Foreign Exchange Rates API for Currency Conversion

Administrator Certification Maintenance (Spring '21) Questions

Salesforce App Builder - Question Set 5