I have a time based workflow which sends mail to opportunity Owner 7 days before the close date. Whenever close date gets changes, the time based workflow scheduling for mail also get changed. Everything works fine.
Now, the problem comes when someone make the opportunity as private, when a opportunity becomes private, salesforce does not fire workflow rule for it. Now , Opportunity has closed date say Dec 30 2013, and time based workflow schedule mail for Dec 23. Someone make the opportunity private then changes the closed date for March 30 2014. Now, as the opp is private and mail date does not get changed.Owner will get the mail on Dec 23 even if the close date changed to March 30.
Can i schedule a time based workflow with trigger only. without any involvement of workflow.
Please suggest.
Best Answer
I honestly did not know that private opportunities did not trigger workflows. Good to know.
You could accomplish this with some scheduled Apex. I would still allow your workflow to send them emails for non private opportunities, but create a class to address the private opportunities.
I put this together from a few classes that I have, you can obviously adjust it to fit your needs, and change the wording should you want to, but
Something like this should work