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
SFDummySFDummy 

Time based workflow rule - with formula

Hello,

 

I want create a workflow rule that will automaticall update Accounts without editing the record based on the datefield ont he account.

 

I  came across this posting

Set timebased rule without editing existing records

http://success.salesforce.com/ideaView?id=08730000000Br89AAC

 

Is this possible to do now in latest version?

 

If I create a formula filed with like following that changes number every day will that work?

 

Formula field

Remaining Days = Contract_start__c - TODAY()

 

in my workflow rule I will check if Remaining_days__c = 0

 

Any suggestions? Thanks for you time.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
*werewolf**werewolf*

Perhaps you misunderstood.  What you're trying to accomplish cannot be done with time based workflow; you need to use scheduled Apex, as in the example given here.

All Answers

*werewolf**werewolf*

No, scheduling a time based workflow still requires that somebody actually edit the record to trigger it.  You can, however, set up some scheduled Apex that runs at a given interval (every day, say), queries for Accounts that meet its criteria today, and take some action on them.

*werewolf**werewolf*

And no, that formula field won't work either.  Formula fields don't actually change the record at all so they will not trigger workflow.

NPNP

What is your condition on the workflow  ? and also u can only do on picklist value .... not on formula field ..

 

I just now did a timebased workflow which will fire every hour based on last modified when the quality of the account is 5 star and then picklist value will go to the next star, so this will do only 1 time now . so we must have a condition which will be met all time ..... which i think we can do it in this case. hope this gives u some hint to work on ...

 

something like 

,,,,,Rule Criteria

Account: Qualityequals4 Stars,2 Stars,5 Stars,3 Stars

 

 

 

 

 

SFDummySFDummy

Hello NP

 

I have a contract start date that determines rates polulation.  It is only on the first of the month. (monthly)

I have about 600 accounts that needs rate updates everymonth that I am trying to automate

 

Most of the time these account are not touched for the whole year.  

 

based on your suggestion I should create timebase to check daily for the date if date matches (4/1/2011 = TODAY())

But there is only before or after option for time based. How did you specifiy every hour?

 

Thanks

*werewolf**werewolf*

Perhaps you misunderstood.  What you're trying to accomplish cannot be done with time based workflow; you need to use scheduled Apex, as in the example given here.

This was selected as the best answer
SFDummySFDummy

Thanks for the information.

 

I have trigger on Account that populates rates base on a flag UpdateRates = True

trigger AccUpdateRates on Account (before insert, before update) { }

Trigger calls a class after checking mutiple conditions

    AccountUpdateRates.UpdateProductRates(AccList, ProdIDs);

 

 

to use the scheduled Apex Job What should I do?

  I have to change my class to handle @furture call

  Create class that sets this flag UpdatesRates = True

  Which will inturn fire my trigger?

 

or Move my complete code to class?

 

Once I covert the class to handle @ furtue can I use both from trigger and in Apex job?

 

Appreciate your comments....

 

Thanks

 

 

 

*werewolf**werewolf*

If you want people to do whatever it is by manually updating the account also, then leave it in the trigger, and just have your scheduled Apex touch the account in the same way; in doing so, the scheduled Apex will indeed fire the trigger.

 

One thing to add to that example I linked to is that inside your scheduled code you can call System.schedule again to schedule it for the next hour or day.  That way you'll have a scheduled process that never ends.

SFDummySFDummy

Thanks for the tip. I am going to startworking on this solution.