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
RoxyGirlRoxyGirl 

Need help with formula please!!

I know this should be simple but for some reason I cant get it to work.

The syntax checker keeps telling me that the last 3 on the opp owner id are "extra"

 

I am trying to set up an email workflow rule to send an email when opportunities with specific owners have the close date changed. Here is what I have

 

OwnerId =xxxxxxxxxxxxxxx OR Ownerid = xxxxxxxxxxxxxxx OR Ownerid = xxxxxxxxxxxxxx OR Ownerid = xxxxxxxxxxxxxxx  AND ISCHANGED(CloseDate )

 

Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
Math are more funnerMath are more funner

Kylet is right on spot.

 

The following is in the ischanged function help.

 

This function is available only in:

  • Assignment rules
  • Validation rules
  • Field updates
  • Workflow rules if the trigger type is set to Every time a record is created or edited.

Is your Every time a record is created or edited trigger type turned on?

All Answers

Math are more funnerMath are more funner

We are not yet using Workflow, but I am assuming that the formulas work the same there as in other formula situations.

 

You will want to put quotes around the ownerid # and use || for or and && for and.

 

I also recommend when using or and and statements in the same formula, using parathesis to definitely indicate to the program what you want to do first.  A math example of this would be 1 + 2 * 5.  Do I want 1 + 2 then multiply five (15) or 2 * 5 then add 1 (11).  It probably would not make a difference in the result of this formula but habits such as these can really save headaches in more convoluted formulas.

 

(OwnerId  ="xxxxxxxxxxxxxxx" || OwnerId  ="xxxxxxxxxxxxxxx" || OwnerId  ="xxxxxxxxxxxxxxx" || OwnerId  ="xxxxxxxxxxxxxxx")  && ISCHANGED(CloseDate)

RoxyGirlRoxyGirl

Thank you for your reply, your solution eliminated the errors I was getting but now it is telling me that I cannot use ISCHANGED in the formula. Do you have any ideas on how to return the results I need without using the ISCHANGED?

 

Thanks too for the info to keep in mind when creating formulas, that will be most helpful in the future.

kyle.tkyle.t

You need to evaluate the rule "Every time a record is edited or created" in order to use ISCHANGED

Math are more funnerMath are more funner

Kylet is right on spot.

 

The following is in the ischanged function help.

 

This function is available only in:

  • Assignment rules
  • Validation rules
  • Field updates
  • Workflow rules if the trigger type is set to Every time a record is created or edited.

Is your Every time a record is created or edited trigger type turned on?

This was selected as the best answer
RoxyGirlRoxyGirl

That worked - Thanks!!!!!!