Ask Search:
Tricia OwenTricia Owen 

Create Tasks via button

Hi - I'm looking for a way to automatically create a series of tasks based on a button click from the Opportunity.

Subject:  xyz
Assigned to: Opportunity Owner
Date:  Current date + 5
<Custom Checkbox Field> =  true

What is the best way to do this?  I would prefer to handle via configuration (i.e. Custom Button, Workflow, Task Creation), but I can't see how.  Also, using the create task function, can you default a custom field to a set value when it's created via the button click?  It almost looks like I'd need to have a Field Update workflow to update this custom field (based on the Subject) after creation.

Rajith MedaganiRajith Medagani
Can you explain what you mean by Series of Tasks. Do you mean multiple tasks be created at single button clic ?
Tricia OwenTricia Owen
Yes, Rajith, that's it... multiple tasks by a single button-click.  Each task would have a different subject and due date.  But, the same set of tasks would be created by the button click.
Rajith MedaganiRajith Medagani

okay, Creating or updating a record is a DML operation and I do not see a way to do this without even using a Workflow Rule. Since manipulating the data is at any time an interacting with the database which will involve code. Just a button cannot create records without using code, unless you are currently on the record itself from the UI or using the New or Save buttons provided by Salesforce.

Peter AubreyPeter Aubrey
Check out the following app in the App Exchange:

Action Plans encapsulates best practices into reusable task templates. An Action Plan can be created for an Account, Opportunity, Contact, Lead, Campaign, Case or Contract. Template tasks can be pre-assigned to a specific individual, assigned to the running user or assigned to a running user.

I think you'll struggle with the Custom Field requirement though, not looked at the package in detail so not sure if you can specify Custom Field values.
Bryan BoroughfBryan Boroughf
Take a look at Actions Plans, from Labs.  It comes as an unmanaged package from the AppExchange, so if might be a good place to start, if nothing else.
Tricia OwenTricia Owen

I think Action Plans will work for me.  I just added a keyword in the 'Comment' for the activities, and then I set up a field update workflow so that on activity create, the custom field defaults to 'true'.

Thanks everyone!