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
fsiddiq3fsiddiq3 

Help with a parameter issue

Hello,

 

  I am trying to create a field update for 2 fields in an object. One field is called status and is a picklist and the other field is called probability which is simply a percent field. I am trying to create a field update that says when status is changed to "completed", then make the probability equal to 100. Here is the formula I created below:

 

IF (ISPICKVAL( Status__c ,"Completed") , Probability__c = 100)

 

I am getting this error message: Error: Incorrect number of parameters for function IF(). Expected 3, received 2

 

Can somebody help me?

Best Answer chosen by Admin (Salesforce Developers) 
NPMNPM
Yes - with an IF you need to include a result if True and a result if False.  Right now in your formula you only have one result.

All Answers

NPMNPM
Yes - with an IF you need to include a result if True and a result if False.  Right now in your formula you only have one result.
This was selected as the best answer
fsiddiq3fsiddiq3

Ok, so if its false and status is not equal to completed I want the probabality to remain the same was it was before. What do I use?

 

I dont want to say null or 0 because that would change the probability to 0 if its not equal to completed which I don't want to have it do.

 

NPMNPM

Just be sure if you are trying to complete a field update you need to have a workflow rule trigger, then a field update that executes when the workflow ifs triggered.  It looks like you may be trying to do everything with one formula.  You need to set up both. 

 

Your workflow criteria would be

 

Status__c   =  "Completed&quot"

 

 

then your field update would be:

 

Probability__c = 100 

fsiddiq3fsiddiq3
OHH!! Of course!!
fsiddiq3fsiddiq3
Thanks a lot! That worked, I don't know why I didn't see that before. This was a very simple fix. Thanks once again.