We have a scenario that user invokes a callout via lightning component button. Its an http request to an external service, and on response - there is an update in SF. We would like that the running user of the callout request will be sent from a different user - Integration user- than the one who pressed the button.

How can we achieve that?

Any help will be appreciated!!

1 Answer 1

  1. Create a Named Credential with the authenticating user = Integration User
  2. Do an APEX Http Callout that references the named credential callout:thenamedcred/restofpath to an Apex REST service that executes in your own org.
  3. The Apex Rest Service will be invoked as if run from Integration User
  4. The Apex REST service can then do database updates

An alternative is to publish a Platform Event that will be consumed as Automated Process User. You can have a trigger/flow/Process Builder asynchronously consume that event and do the update. However, at present, all Platform Events run as Automated Process user.

  • Can I run the http post request from the integration user as well? From the rest service?
    – daveDev
    Feb 12, 2019 at 5:43
  • @hanale - if you mean the http Post request to the third party system - that 3rd party system presumably has its own authentication requirements so it is not really relevant what SFDC running user does that callout; provided that running user is allowed to do callouts at all
    – cropredy
    Feb 12, 2019 at 18:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .