You need to sign in to do that
Don't have an account?
MARCO SELLERI
Trigger to update status opportunity field based on opportunity created date
Hi all,
I've a question, maybe it's simple, but I'm pretty new on this..
I need to update the opportunities status, once the current date is 7 days older than the opportunity created date and the same status is "open"..
example:
an opportunity has been created the 10th of May 2017 (and it's status is "open"), but after 7 days, if the status is still open, I need to set it to "closed".
In my case the opportunity is a custom object.
Can you help me with that? I've tried but I'm not able to find the correct solution.
Thanks
I've a question, maybe it's simple, but I'm pretty new on this..
I need to update the opportunities status, once the current date is 7 days older than the opportunity created date and the same status is "open"..
example:
an opportunity has been created the 10th of May 2017 (and it's status is "open"), but after 7 days, if the status is still open, I need to set it to "closed".
In my case the opportunity is a custom object.
Can you help me with that? I've tried but I'm not able to find the correct solution.
Thanks
I don't believe you need a trigger, you just need a time-based workflow. A trigger will only work if someone updates the record and I don't think that is happening since the status has not changed.
Quick Find -> Workflow Rules
New Rule
Select your object
Give the Rule a name and change the Evaluation Criteria to Created.
Rule Criteria: Status = Open
Save and Next.
Time-Dependent Workflow Actions
7 Days After Your Object: Created Date
Add New Field Update:
Update status to Closed.
Then activate, and you should be good to go. It doesn't help with current records, you will need to have a different solution for those existing records.
Hope this helps,
Kaj