1

An external process @mentions a user in a chatter post with a link to a sObject record. I am trying to determine how or what the url structure for the sObject record should be so that they are redirected to the record within the app.

Let's say I want to redirect the user to the account record inside of Salesforce1. I tried using the following:

salesforce1://sObject/<accountId>/view
com.salesforce.salesforce1://sObject/<accountId>/view
* replace <accountId> with the record id

The problem with the links above is that they are not clickable inside the app. I also tried using the following which is clickable but opens another "browser" window inside the app, and doesn't do a redirect to the record.

https://<instance>.lightning.force.com/one/one.app#/sObject/<accountId>/view
* replace instance and accountId with actual values

Is there a url scheme I can use to redirect the user to the record inside of Salesforce1 app?

1

When attempting to invoke a specific record from outside of the Salesforce1 app, I use this URI scheme: com.salesforce.salesforce1://entity/view?entityId={Your.Object.Id}

I frequently leverage this in email templates that have desktop / mobile links, as some email apps will not pass the user into the Salesforce1 app (Gmail and Chrome do, but Mail and Safari do not). When the user clicks this link, it opens the Salesforce1 app's splash page, and redirects the user to whichever record they expect to view.

I have only leveraged this for directing a user to a record detail page, so I'm not sure how you would open a VF page from outside of the Salesforce1 app.

  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Sergej Utko Apr 1 '15 at 12:42
  • @mast0r do you suggest adding context around its usage, and the behavior that exists when requested? – Roger Mitchell Apr 1 '15 at 12:43
  • Thanks! possibly a stupid question, but how do I make this url clickable when viewed in a Chatter post? I'm using ConnectApi.LinkSegmentInput. – Anup Apr 1 '15 at 12:46
  • 1
    @Anup this link is best used when trying to open the Salesforce1 app and direct the user to a specific record. If you are creating a link post in Chatter, you can use the standard URL (customdomain.my.salesforce.com{!RecordId} or instance.salesforce.com{!RecordId}); when the user clicks this within Salesforce1, they are directed to the appropriate record. I use the other URI scheme to direct a user from outside of Salesforce1 into the app (e.g. email template with "click to view in S1" link) com.salesforce.salesforce1://entity/view?entityId={Your.Object.Id} – Roger Mitchell Apr 1 '15 at 12:49
  • @RogerMitchell Yep, it would be very useful! – Sergej Utko Apr 1 '15 at 12:51
0

Try using sforce.one.navigateToSObject()

http://www.salesforce.com/us/developer/docs/salesforce1/Content/vf_dev_best_practices_navigation.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.