• Margaret Martin 4
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 0

Hey guys -
I have a unit test that is exhibiting surprising behavior. In our code there is a trigger on Contact that runs when the contact is inserted/updated & in that trigger there is a future method (callout=true if that makes any difference) that also executes on insert/update.

I have a unit test that runs as a Community user. In the test setup, running as a different admin user, a Contact is created and then the test is run as the Community user.

In the log output, the trigger runs as the admin user & invokes the future method, effectively putting it on the 'future queue'. My expectation was that the @future method would execute as the same user that ran the initial trigger, or - possibly - that it would run in system mode. But what I am seeing is that when the @future method is executed, it is executed as the current user. 

Can I really not know what user my future methods will run as? Is this a bug in the testing framework? Can anyone shed some light on this issue?


Hey guys -
I am trying to put together a somple POC with an external postgres database hosted on Heroku using Heroku Connect to provide an oData 2.0 datasource. I am able to see the data in Salesforce, but am having difficulty creating or updating it. Both create & update from the UI result in a CSRF error, despite having enabled CSRF protection on the datasource. In the error message it mentions something about "More information is available with DEBUG=True", but I can't figure out where to set that value in order to get more information.

Has anyone had some success with this? Have any pointers for how to configure/debug? Are writeable external objects using Heroku/Salsforce connect even possible?

Thanks a bunch -