locked
Can I set the Created By when workflow creates entity RRS feed

  • Question

  • Hi,

    I have a workflow that creates Account. This workflow runs as an On-demand process. User starts it from entity form. When the Account is created by this workflow, the owner of the workflow is set to the created by of new Account. Is it possible to run the workflow as the user who starts it and thus have this user to the created by field of new Account?  

    Friday, October 10, 2014 12:46 PM

Answers

  • Sorry my messy question. I tested this a little more and found

    1. If User starts workflow from entity forms "Run workflow" button, then the Workflow runs with Users credentials as you say.

    2. If the workflow is started when "Record field change" then it is runs with workflow Owners credentials.

    3. If I change the workflow to real-time workflow then i got option to choose "Execute as the user who made changes to record"

    So nr. 3 solves my problem. I still wonder if there still is possiblity to run background workflows as  "Execute as the user who made changes to the record"?

    • Marked as answer by JokiJani Monday, October 13, 2014 12:18 PM
    Monday, October 13, 2014 12:18 PM

All replies

    1. "This workflow runs as an On-demand process": strictly speaking a workflow cannot run an on-demand process, the workflow, even if it is an on-demand, runs as a child process if it's run from another workflow
    2. "User starts it from entity form": so the workflow itself is an on-demand process, I assume
    3. "When the Account is created by this workflow, the owner of the workflow is set to the created by of new Account"- yes, when you create an account, you are by default the creator and the owner
    4. "Is it possible to run the workflow as the user who starts it" - yes, in fact it is the only way for an on-demand workflow. The on-demand workflow runs as the user who started it
    5. "Thus have this user to the created by field of new Account" - this should be the case. If it isn't, I suspect the reason might be that you have workflows invoking other child workflow. Can you please clarify this?
    Friday, October 10, 2014 2:26 PM
  • Sorry my messy question. I tested this a little more and found

    1. If User starts workflow from entity forms "Run workflow" button, then the Workflow runs with Users credentials as you say.

    2. If the workflow is started when "Record field change" then it is runs with workflow Owners credentials.

    3. If I change the workflow to real-time workflow then i got option to choose "Execute as the user who made changes to record"

    So nr. 3 solves my problem. I still wonder if there still is possiblity to run background workflows as  "Execute as the user who made changes to the record"?

    • Marked as answer by JokiJani Monday, October 13, 2014 12:18 PM
    Monday, October 13, 2014 12:18 PM