I am looking to open a particular object's record in salesforce after clicking a link in some another web app. With the link click I need to pass some set of attributes to Salesforce webservice (wondering what this would be) and this webservice after running some logic need to open a particular object record in Salesforce. Any Ideas/Direction/Samples?

  • In your other web app, do you know the Salesforce record id of the record you're trying to open? (18 char alpha-numeric) – Mark Pond Jul 3 '18 at 21:59
  • Thanks Mark for the reply. i wouldn't know the recordID before hand, this needs to be determined by SF webservice first and then possibly redirect to it. – Prasadium Jul 4 '18 at 15:03

A Salesforce web service does not have an associated UI context. You'd need to structure your web service to return a record Id, whose URL your remote web app can construct and direct the user to, or return the appropriate URL directly to your web app, which can then open or redirect as needed in its UI.

Barring elaborate architectures with Platform Events and similar, you're not going to be able to reach into an open Salesforce session from an outside web app, and there would certainly be an intermediate, asynchronous step between the web service you build on Salesforce and the Salesforce UI - such as posting a Platform Event or inserting some data that a UI is polling for.

| improve this answer | |
  • Thanks David for the reply. This gives me a direction to look into now. – Prasadium Jul 4 '18 at 15:02

The simplest possible integration, assuming you know the record id which needs to be opened is to navigate the browser to that record when your user clicks the link.

Method 1

If you've got the My Domain of the org where this record exists, using it for the base of the URL is the best choice.

Given a My Domain of universalcontainers.my.salesforce.com the URL that you would navigate the user to would be:


If the user is already authenticated in this org, they'll see the record, if they are not yet authenticated they will be asked to login and then shown the record.

Method 2

If you do not know the My Domain value for the environment, you could instead use the base login URL and follow the same pattern of appending the record id to the URL.


(If the target record exists in a sandbox rather than in a dev or production org, the above URL would be test.salesforce.com)

Method 1 is preferred because the My Domain functionality allows for Salesforce to have context about the target org ahead of time and present configured functionality for that org such as a branded login screen or a custom SSO implementation rather than the standard Salesforce login dialog.

| improve this answer | |

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.