Last active
April 2, 2018 20:13
-
-
Save samteezy/399832153c88537a26a31b92bbfbd564 to your computer and use it in GitHub Desktop.
Create a task via a flow where Community license users are not allowed to create tasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class createTaskFlow{ | |
| @InvocableMethod(label='Create task' description='create tasks') | |
| public static void insertTasks(List<Task> tasks) { | |
| // system.debug('tasks ' + tasks); | |
| // Note this is built for inserting just one task and is not bulkified. | |
| for (task t:tasks){ | |
| task newTask = new task(); | |
| newTask.priority = string.valueof(t.priority); | |
| newTask.status = string.valueof(t.status); | |
| newTask.ownerId = t.ownerId; | |
| newTask.whatId = t.whatId; | |
| newTask.subject = string.valueof(t.subject); | |
| newTask.description = string.valueof(t.description); | |
| insert newTask; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment