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
Georgia2Georgia2 

Currency IF, ISPICKLIST formula

I have a custom object "Sales Order Line Item" with an Amount field that equals 

Unit_Price__c * Quantity__c

 

There is also a pick list field called Line Status that can equal Open, Closed, Hold or Cancelled

 

I need to create a formula that will make the Amount equal zero if the Line Status equals Cancelled.  Otherwise, it will equal the above.

 

I have the below formula, which obviously isn't right.  any suggestions would be great!!  Thanks

IF( ISPICKVAL(Line_Status__c, "Cancelled (X)", 0), Unit_Price__c * Quantity__c)

 

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

You're missing a RIGHT Paren to close out your ISPICKVAL statement.

 

Like this:

 

 

IF(ISPICKVAL( Line_Status__c, "Cancelled (X)"), 0.00, Quantity__c * Unit_Price__c )

 

 

 

All Answers

Steve :-/Steve :-/

Are you looking for a result like this?

 

 

IF(ISPICKVAL( Picklist_Field__c, "A"), 0.00, Numeric_Field__c * Currency_Field__c )

 

Quantity = 5

Unit Price = $20.00

 

IF Picklist = "A" THEN $0.00,

ELSE (Quantity * Unit Price) = $100.00

 

*** Make sure that the Picklist Value in your Formula matches the value in the Picklist EXACTLY (spelling, punctuation, Proper Case, etc.) otherwise your formula won't work, but you won't get an error.

 

Message Edited by Stevemo on 02-01-2010 06:58 PM
Georgia2Georgia2

So that is what I am looking for, but it doesn't work.  I receive the error- Error: Syntax error. Missing ')'

 

See the formula below

IF( ISPICKVAL(Line_Status__c, "Cancelled (X)", 0.00, Unit_Price__c * Quantity__c)

 

 

I imagine because of the parantheses in "Cancelled (X)".  But that is exactly the format of the value.  And I can not remove the parantheses as it is needed for our integration with our ERP system.

 

What do you think??  thanks

Steve :-/Steve :-/

You're missing a RIGHT Paren to close out your ISPICKVAL statement.

 

Like this:

 

 

IF(ISPICKVAL( Line_Status__c, "Cancelled (X)"), 0.00, Quantity__c * Unit_Price__c )

 

 

 

This was selected as the best answer
Georgia2Georgia2
ah ha!  Thank you!