RE: How to set 'modifiedby' field on Note entity through code?
Hi Priyank ,
How you are triggering the workflow ? Is it asynchronous or synchronous ?
When a background workflow is configured as an on-demand process and is started by a user using the Run Workflow command, the actions that the workflow can perform are limited to those the user could perform based on the privileges and access levels defined by the security role(s) set for their user account , and modify by field should be fill with the user account who executing the workflow.
When a background workflow starts based on an event the workflow operates in the context of the person who owns it, usually the person who created the workflow. In that case modify by field should be fill with the workflow owner.
For real-time workflows you have the Execute As option and you can choose whether the workflow should apply the security context of the owner of the workflow or the user who made changes to the record.
If your workflow includes actions which all users would not be able to perform based on security constraints, you should choose to have the workflow run as the owner of the workflow.