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
praveen venkatapraveen venkata 

Is it possible to send a mail to that user when he dont create new opportunity for 10 days

Email Reminder after 10 days if the Opportunity owner does not create a new opportunity

 

Can we achieve it either by Workflow or Trigger?

If possible please give me sujestions?

 

 

 

Thanks and Regards,

Praveen.

sfdcfoxsfdcfox

There are several possible means of accomplishing this. Here is one possible approach:

 

1. Create a custom field called "Last Opportunity Date" on the user.

2. Create a trigger on Opportunity that updates this field.

 

trigger UpdateLastOppDateField on Opportunity (after insert) {
    User u = new User(Id=UserInfo.getUserId(), Last_Opp_Date__c=Date.Today());
    update u;
}

3. Create a workflow rule with a time-based action that triggers on Last_Opp_Date__c is not null, with a time action of 10 days after Last_Opp_Date__c that sends the email.

 

Workflow Rule Name: notifyUserNoOppsRecently

Criteria: Last Opp Date not equal to <no value>

Time Action: 10 Days after Last Opp Date - Send Email

sandeep@Salesforcesandeep@Salesforce

Because it is possible to write flow rule over user object so what we can do is: 

1. We will create a field on Opportunity "LastOpptyCreatedDate" ( date time type).

2. Write a trigger on Opportunity which will update User's one field "LastOpptyCreatedDate" on record creation.

3. Now we will write time based Workflow for each 10 days ( with evalutng criteria Today() - LastOpptyCreatedDate= 10)