0

Is there a way to accomplish this with a workflow instead of a trigger? I would like to update a custom date field (Opportunity Stage Change) to TODAY() whenever the new opportunity stage is Cold OR whenever the priorvalue is Early Negotiation.Either way would work for me. I have seen a few solutions with trigger but I'm trying to get this done using either a Workflow or Process Builder.

Here is what I got for the workflow but I'm doing it wrong:

IF(ISPICKVAL( StageName ) = 'Cold',
              (IF(ISPICKVAL(PRIORVALUE( StageName ) , 'Early Negotiation'),  Opportunity_Stage_Change__c = TODAY(), null),null)

I'm getting the following error, but I think there is a bigger problem with the logic/approach.

Error: Syntax error. Missing ')'

  • i counted your number of parenthesis and they dont seem to add up, so, the error message is pretty self explanatory. – glls May 3 '18 at 15:22
  • Also important, you're not calling the ISPICKVAL() function correctly (it takes two parameters), and you can't assign the Opportunity_Stage_Change__c field IN the formula. Use a Workflow Rule Field Update to do that piece. – David Reed May 3 '18 at 15:23
  • 1
    Have you created a duplicate account? I am pretty sure I've seen a very similar username/avatar combo. Please don't maintain multiple accounts. You can contact the community team to get your accounts merged. – Adrian Larson May 3 '18 at 15:25
  • I haven't, Adrian. I deactivated my account in the past and just logged back in. – user56320 May 3 '18 at 15:26
  • @glls Yes. I know, but I really looking for a help like David Reed provided. Thought that was pretty self explanatory with my last sentence. – user56320 May 3 '18 at 15:29
0

Please make sure to use the formula function reference tools (either in the documentation or within the formula editor) to check how you use each function, and make sure you're providing the right number and type of parameters.

Any time you use words like "and" and "or" in describing your objectives, you'll probably find the AND() and OR() functions in your formula. Here, you need an OR().

You probably want to use a formula like this to decide whether your Workflow Rule or Process Builder is executed:

OR(ISPICKVAL(StageName, 'Cold'), ISPICKVAL(PRIORVALUE(StageName) , 'Early Negotiation'))

Then the actions you provide in Process Builder or WFR handle the assignment of the value TODAY() to your custom field. You can't perform assignment (or, indeed, make any data changes) within a formula

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy