I need to create a report which has manually created tasks only. Is there is any way to know if a task is created manually or with workflow/apex code, thanks in advance.
-
1you could add a required field to the Task page layout - "I am not a robot" with picklist values: Yes/No.– cropredyJan 3, 2018 at 2:21
-
1Another way is if your user is API only user you can check for the user permissions after record is inserted and set a field automatically on the task. This would mean you strictly follow user setup to ensure it doesn't report false data.– RedDevilJan 3, 2018 at 2:24
-
But If I add this required field, will this affect already existing workflows/apex. I might have to change everything correct?– LinJan 3, 2018 at 2:34
1 Answer
Generally it's not possible to determine whether records were created or changes made by a human in the UI or by automation as such. Some organizations choose to run scheduled and bulk processes, or integrations, on separate users, which allows their changes to be identified by their username.
Workflows and Apex triggers run in the context of the user who performed the action that caused them to run. If a user makes a record change that causes a trigger to fire that then inserts a task, the task will show that that user created it.