You need to sign in to do that
Don't have an account?
Katrina_Harsh
Creating Apex Trigger for a task.
Hello,
I am trying to write a Apex Trigger that can populate a custom field (checkbox), so my workflows will function properly. Right now the workflows function perfect for tasks that are created within Salesforce, however; when tasks are created from Outlook to Salesforce, none of the workflows get triggered.
I have attempted writing the trigger in multiple ways, based on what I have found in research, but none of the options are pulling correctly. Can anyone provide a solution on how the apex should appear so that when a checkbox is populated to TRUE the workflows will then be triggered? This way when a task is created in Salesforce or in Outlook, they will automatically populate this checkbox and the workflows will then be dependent on the custom field.
Thanks,
Katrina
I am trying to write a Apex Trigger that can populate a custom field (checkbox), so my workflows will function properly. Right now the workflows function perfect for tasks that are created within Salesforce, however; when tasks are created from Outlook to Salesforce, none of the workflows get triggered.
I have attempted writing the trigger in multiple ways, based on what I have found in research, but none of the options are pulling correctly. Can anyone provide a solution on how the apex should appear so that when a checkbox is populated to TRUE the workflows will then be triggered? This way when a task is created in Salesforce or in Outlook, they will automatically populate this checkbox and the workflows will then be dependent on the custom field.
Thanks,
Katrina
You could read about trigger development here: http://forceschool.blogspot.in/search/label/Apex%20Triggers
In order to make your workflow run. You should have a before insert trigger on Task and populate the check box value.
Workflow execution happens after the triggers so it should invoke the workflow. Let me know if you face any issues.
Thanks
Shashikant
Thank you Shashikant,
I know that I need to use a "before insert" trigger, but I am having a difficult time writing the entire coding to check the box properly. Can you tell me if I am on the right track?