function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Iswarya Sekar 9Iswarya Sekar 9 

I want to create a task along with due dates when opportunity has different stages.

When an opportunity goes into a certain stage, we would like tasks representing the “next steps” to be automatically generated. Requirements include:
  1. Tasks should only be auto-generated for records with a record type of National Account
  2. All tasks should be assigned to the opportunity owner
  3. If the opportunity is moved to the next stage while there are incomplete auto-generated tasks, those open tasks associated with the prior stage should be closed, with a completed date reflecting the same date that the opportunity stage changed.
    1. Note that tasks that have been manually created by the user should be kept open.
The tasks to be auto-generated for each stage are as follows:
StageTasks
ProspectingTask Name: Complete Sales Information
Due Date: 2 Business Days from Stage Start
Idea GenerationTask Name: Product Sourcing
Due Date: 3 Business Days from Stage Start
 
Task Name: Send Presentation
Due Date: 5 Business Daye from Stage Start
 
Task Name: Idea Presentation Follow Up
Due Date: 8 Business Days from Stage Start
Sample RequestTask Name: Order Samples
Due Date: 2 Business Days from Stage Start
 
Task Name: Sample Follow Up
Due Date: 7 Business Days from Stage Start
Proposal / Price QuoteSend Quote – 5 Business Days from Stage Start
Quote Follow Up – 7 Business Days from Stage Start
Negotiation / ReviewN/A
Closed WonN/A
Closed LostN/A
 

 
 
Pradeep SinghPradeep Singh
Hi, This can be done using trigger.
Iswarya Sekar 9Iswarya Sekar 9
Can you send me the code?