+ Start a Discussion
riffindusriffindus 

Help with if condition in formula for field update

I am using a workflow to update a field based on condition of a picklist. and on false condition, i don't want any update at all, because the record gets locked for other picklist values and it is throwing error since it was not able to update. how can i achielve the same.

 

IF( ISPICKVAL( StageName ,"lead") , "S","")

 

if stagename is lead, i want to update S in the field and don't want anything to do when it is not lead.

 

Best Answer chosen by Admin (Salesforce Developers) 
Jeff MayJeff May

For time-dependent Workflows, if the record is edited and no longer meets the criteria, Salesforce will remove the 'scheduled action' from the queue automatically.

All Answers

Jeff MayJeff May

Put your condition in the Workflow Rule so the rule is only true when you want to apply the Field update.

 

 ISPICKVAL( StageName ,"lead")

 

Then the Field update would be " set field to 'S' "

riffindusriffindus

Nope, that is not possible because

 

1. Whenever the lead comes in, all the leads will have the status as 'leads', so all the leads will be eligible

 

2. we are using this in time based workflow rule, so in the meantime if the user changes the status then it becomes locked with the user and syatem is failing to update.

Jeff MayJeff May

you can add additional criteria to the Workflow Rule so it is only the records you care about.

riffindusriffindus

All the criteria's were added....

 

Is there any other way i can trigger an update after 5 days and i want the criteria to check before field update?

 

 

Jeff MayJeff May

For time-dependent Workflows, if the record is edited and no longer meets the criteria, Salesforce will remove the 'scheduled action' from the queue automatically.

This was selected as the best answer
riffindusriffindus

Jeff,

 

so you mean the record which already met criteria and queued in the timebased workflow will be removed back if the criteria is changed in the meantime?

 

ex: a record with status "lead" is there in time based workflow queue because the riteria met during creation. later on if the user changes the lead status to "stale" and the record is becoming locked, so the ecord will be out of the queue.

 

per our setup, we are looking for lead status but still the record is not eliminating

Jeff MayJeff May

That is correct.   The Workflow actions will not be run for records that no longer meet the query

riffindusriffindus

I have set that option in production. I will look for any errors and will mark it back as "Solution"

riffindusriffindus

No error was thrown after this setup, so marked it as Solution.

 

Thanks Jeff