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
anurajanuraj 

If condition.

I have an object called product__c. It has Quantity__c, Reorder_Level__c, result__c fields. 

I am doing workflow rules and setting the Rule Criteria 

I want to check whether the Quantity__c less than Reorder_Level__c. Then change the result__c to '0' else the value should be'1'.

Tell me how should I use the if condition in formula editor

Best Answer chosen by Admin (Salesforce Developers) 
srikeerthisrikeerthi

Hi 

 

If you want a Formula field of the condition you specified then

 

You can do that in this way

 

1.Set result__c as a Formula Field and return type as Number.

2.In the formula you write as IF(Quantity__c <Reorder_Level__c,0,1).

All Answers

srikeerthisrikeerthi

Hi 

 

If you want a Formula field of the condition you specified then

 

You can do that in this way

 

1.Set result__c as a Formula Field and return type as Number.

2.In the formula you write as IF(Quantity__c <Reorder_Level__c,0,1).

This was selected as the best answer
anurajanuraj

sir 

   I am new to salesforce. Now i am using workflow Rules. Their is no option for  Formula Field. Can u tell me how to set 

   the formula field.

 

   I wrote the formula as

     IF( Quantity__c  <  Reorder_Level__c  ,  result__c  = 0, result__c = 1)

     

srikeerthisrikeerthi

Ok

 

I understood your problem,

 

Try this 

result__c= IF(Quantity__c  <Reorder_Level__c  ,0,1)