• Steve :-/
  • 9675 Points
  • Member since 2005
  • Fixer of Shit
  • You owe me a beer, Inc.

  • Chatter
  • 366
    Best Answers
  • 131
    Likes Received
  • 1
    Likes Given
  • 4
  • 2589
Hi ,

Could anyone help me out in the below function..Actually i need to apply to formula to the field which depends on some other field.
I created a picklist field which contains BOX,Class-A,Class_B,Class-C.
If anyone selected BOX in that picklist field then automatically Ticket fare has to reflect as 100,if they selected Class-A then 75 has to reflect and so on.....

I written a formula....But it is not working out...

IF( Ispickval(Seats_Category__c ," Box"),100
Ispickval( Seats_Category__c ,"Class-A"),75
 Ispickval(Seats_Category__c," Class_B"),50
   Ispickval(Seats_Category__c," Class-C"),25,0

I've created a validation rule that allows for a field to become mandatory when it meets certain requirements; works great.  However I now need to have this rule not apply to a specific record type and I'm having problems adding it to the rule.


Here's the original rule:

AND( OR( BEGINS( "FL", Account_State_Province__c ), BEGINS("USA",  Account_Country__c ) ),   ISBLANK( TEXT( Agent_Sales_Rep__c )))


the record type is called BBA_Service_Programs and the Id is 01250000000UKIF


I tried adding it on the end using AND but it keeps coming up with errors.


Help is appreciated!


  • October 03, 2012
  • Like
  • 0



I've searched on the boards but haven't found an answer. We have the following case:


We have a lot of fields we need to validate. Some must be > 0, some may not exeed an certain amount, etc...

Instead of copying the same message over and over again by every field, I want to have only a few messages like:

"&1 must be > 0"

"&1 to large".

Where the &1 represents the field. For example:


"BookID must be >0"

"DVDID must be >0"

"BookTitle to large"

"DVDTitle to large"


When we can use a parameters (&1) to represent the fields, we don't have to go through every seperate field to change the message, but I only have to change the message itself.


Does anyone have any idea if an if so, how this is possible?



Hilco Joling




I am trying to set up a workflow email alert to be send to the owner of the record 7 days before the Due Date (date/time field ) if the picklist value Attending__c is not equals  to "Yes"


Thank you



  • September 06, 2012
  • Like
  • 0

How would I update this formula field to display more than one choice?  The Type__c field is a multi-picklist, so I need this formula field to reflect that.  Any help would be greatly appreciated.  It currently only displays one choice even though the type field on the account I'm looking at displays 2.


IF(INCLUDES(Type__c,"End User"),"End User","")))


I can't figure out why I am getting an Extra comma message referring to the comma after (ISPICKVAL(Status__c,"Done Not Reviewed"))))



(AND(Question_Group__c = "A",Answer__c = "Yes"),
(AND(Question_Group__c = "C",Answer__c = "No")),
(AND(Question_Group__c = "B",Answer__c <> " "))),
(ISPICKVAL(Status__c,"Done Not Reviewed")))),"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA",

Competitor Final Rate / KP Final Rate is giving #Error! on Rate Position.  How would I create a condition that if the number is 0, leave as blank?  Thanks.

How do I create a validation rule to prevent entry of $0.00?  Thanks in advance.

My Goal is to insert the Account Site Address in the Contact Site Address field when appropriate, otherwise leave the current value (which could either have data or not).


I would like to avoid Apex coding and am trying to use an IF statement in a workflow but don't know how to keep the current value in the "value_if_false" portion of the formula.  Is this possible in the Salesforce "IF" formula or are there alternative methods?


Any help/suggestions are appreciated!

  • August 03, 2012
  • Like
  • 0

 My validation rule says that the status of my object can only go from the "Prospect" status to the "Tentative" or "Lost" status values. How can I create a formula to reflect this?

I want to make it so that only users with one of three profiles can edit the Account Name if the record type is Customer.


I have it working for one profile but when I try to add an OR statement and include the two other profiles, it does not work:


Here is what is working now:

( $RecordType.Name  ="Customer"),
 $Profile.Name<>"System Administrator - Integration"


Here's what I tried:

( $RecordType.Name  ="Customer"),


$Profile.Name<>"System Administrator - Integration",

$Profile.Name<>"System Administrator - KM",
$Profile.Name<>"System Administrator - KMGP"



Can someone see what is wrong with the OR part of this formula?


Thank you so much!


Entitlement.EndDate < DATEVALUE(CreatedDate),
ISPICKVAL(Status, 'Open'),
$RecordType.Id = '0123000000008xP'

 I'm trying to write a validation rule to not allow a ticket to be created if the entitlement end date is less than the created date of the ticket.   Any ideas on what I did incorrectly?  



I have the following formula to automatically calculate the end date (start_date__c + 3 month) for all products other than "standard".

However I would like to replace the false IF statement right at the end (null) by [ Month(start_date__c) +12 ] but I get an error message: Error: Incorrect parameter for function 'if()'. Expected Date, received Number


Do you know how to stop getting this error?

Thank you,


if( PricebookEntry.Product2.Name <> "Standard", DATE(YEAR(Start_Date__c),
CASE( MONTH(Start_Date__c)+3,
1, 31,
2, IF( MOD( YEAR(Start_Date__c), 4) = 0, 29, 28),
3, 31,
4, 30,
5, 31,
6, 30,
7, 31,
8, 31,
9, 30,
10, 31,
11, 30,
12, 31,
0 )
), null)


  • July 02, 2012
  • Like
  • 0

Hi everyone,


I am having difficulties with creating  validation rules in the Opportunity page.  What I want is to have a validation rule for the CloseDate field depending on the value from the Stage picklist, as follows:

Stage: Presentation - Close date can't be within 6 months of today


OR (
ISPICKVAL(StageName, "Presentation/Demo"),
ISCHANGED( CloseDate )),
CloseDate - TODAY() < 180 )


Stage: Quote Delivered - Close date can't be within 4 months of today


OR (
ISPICKVAL(StageName, "Quote Delivered"),
ISCHANGED( CloseDate )),
CloseDate - TODAY() < 120 )


Stage: Quote accepted - Close date cannot be within 75 days.


OR (
ISPICKVAL(StageName, "Quote Accepted/Moving to Procurement"),
ISCHANGED( CloseDate )),
CloseDate - TODAY() < 75 )


What is happening now is that the first rule (180 days) works seemingly fine.  But for the second and third, if the close date is outside of 120 days but less than 180 days, I get the error that it can't be within 180 days, and the same thing (with corresponding values for days) is happening for the third rule. 


What am I doing wrong? 






  • June 29, 2012
  • Like
  • 0


The validation rule below is working fine, except for the first line with the date.  I'm trying to change this rule to only work on records with a Created Date later than June 6, 2012. No matter where I put it I get syntax errors.  I also changed OR to AND and it didn't like that either.


OR( DATEVALUE (CreatedDate) >DATE(2012,6,6),


AND(Services__c > 0,
(Product__c <1),
AND(Support__c > 0,
AND(Product__c > 0,


Thank you.



I created this validation rule on the opportunity to prevent users creating new opps if the account has not passed credit checked. (one of the business rules)


true, Account.Credit_Check_Passed__c = false)


It works fine but when converting a lead, this rule prevents from converting.  The "Do not create a new opportunity upon conversion" box is checked by default, and when unckecking it, the validation rule prevents conversion. 


I have been trying to add: AND (ISNEW(), Accountid...... with no luck. How can I make sure that this validation rule only applied when the acocunt is not new. 


Thank you



  • June 22, 2012
  • Like
  • 0




Have a custom object name "Overview", created a new custom field data type "formula" named Account. The Account field is being pulled from another custom object "Highlight". Below is my formula:




However, when pulling the fied into the Overview field, i get the ID format instead (see screenshot: http://cl.ly/HXhM). 


Is there any way I can get it to show the text instead of the ID? 



Trying to create a field update to pull data from a Picklist field from the Product2 object to a text field on the opportunity product object.  Have tried various things like single quotes vs. double quotes, and && or ||  not sure what else to try here.


Keep getting various syntax errors...


IF(ISPICKVAL(Product2.Family,"SNS Surveyor"),'SNS Surveyor’  ||

IF(ISPICKVAL(Product2.Family,"SNS Event Monitoring"),'SNS Event Monitoring'  ||

IF(ISPICKVAL(Product2.Family,"SNS Services"),'SNS Services', "")))


Error: Syntax error. Missing '




I am trying to create a workflow rule to generate a task when the account address is updated. 

However, tasks should not be created following a lead conversion when the address was blank and a brand new one is added.

I have this formula but it doesn't work... Can you please help? 



OR(ISBLANK( BillingCity),ISBLANK( BillingStreet), ISBLANK( BillingPostalCode ),


ISCHANGED(BillingCity),ISCHANGED( BillingStreet), ISCHANGED( BillingPostalCode )))))

  • June 19, 2012
  • Like
  • 0

Hi there


Please help me out with validation rule for saying that email ID has to be entered in a specific format as in 'abcd@xyz.com'. I am new to formulas and validation rules.



  • June 12, 2012
  • Like
  • 0

Seriously???  the word "d*mn" gets a **bleep**?!?  C'mon, it's not like people are droppin' F-Bombs here...

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  


That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it. 

I just thought I'd throw this one up here in case anyone ever has to do something like this on their SFDC Org. 

We need to track revenue on a custom object by Fiscal Period, but the users don't like having to pick and chose a specific date using the Calendar Pop-Up on the standard Date field. So I created a simple picklist with the Fiscal Periods that they want to break out revenue by for Reports, and created a custom Formula(Date) field


This allows us to run reports on Revenue Projections over a period of time using the Formula(Date) field, while the users get to have their simple picklist.



* There are 2 Record Types for the custom object, that's why  one set of picklist values is for FY and another set is for FQ

CASE( Forecast_Period__c ,
"FY 2009", DATE(2009,1,1),
"FY 2010", DATE(2010,1,1),
"FY 2011", DATE(2011,1,1),
"FY 2009-Q1", DATE(2009,1,1),
"FY 2009-Q2", DATE(2009,4,1),
"FY 2009-Q3", DATE(2009,7,1),
"FY 2009-Q4", DATE(2009,10,1),
"FY 2010-Q1", DATE(2010,1,1),
"FY 2010-Q2", DATE(2010,4,1),
"FY 2010-Q3", DATE(2010,7,1),
"FY 2010-Q4", DATE(2010,10,1),
"FY 2011-Q1", DATE(2011,1,1),
"FY 2011-Q2", DATE(2011,4,1),
"FY 2011-Q3", DATE(2011,7,1),
"FY 2011-Q4", DATE(2011,10,1),


Message Edited by Stevemo on 10-02-2009 05:44 PM
Message Edited by Stevemo on 10-05-2009 10:26 AM

I've built a custom App on my Developer SF.Org, and I would like to publish it to my EE Production SF.Org (without having to manually rebuild all of the Objects, Fields, Code, etc.).


I have a *little* bit of experience using the Eclipse Force.com IDE (not even sure if that's a viable option for this). 


I've never Packaged a Custom App before.


Any advice would be greatly appreciated.


Steve :-/


PS.    Oh yeah, as usual money is tight, so getting a 3rd Party App for this is out of the question.

Message Edited by Stevemo on 02-05-2009 12:41 PM
Message Edited by Stevemo on 02-05-2009 12:41 PM

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  


That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it. 

Hi ,

Could anyone help me out in the below function..Actually i need to apply to formula to the field which depends on some other field.
I created a picklist field which contains BOX,Class-A,Class_B,Class-C.
If anyone selected BOX in that picklist field then automatically Ticket fare has to reflect as 100,if they selected Class-A then 75 has to reflect and so on.....

I written a formula....But it is not working out...

IF( Ispickval(Seats_Category__c ," Box"),100
Ispickval( Seats_Category__c ,"Class-A"),75
 Ispickval(Seats_Category__c," Class_B"),50
   Ispickval(Seats_Category__c," Class-C"),25,0

Need formula for pulling CONTACT fields data and mapping it to custom fields in Opportunities


Example: I need the CONTACT address, phone, city, state , fax to populate Matching Custom fields in the Opportunity when I use the a custom Opportunity lookup. So if I use the LOOKUP field and Select a Contact it also populated the address, phone....etc in opportunity.

I have child object to leads called lead details.(leadco).  Working with PE edition with API enabled.

There is a multiple pick list field with multiple choices selected on the child object Leadco.

In order to be able to merge information from this pick list into Email template ( mass email from leads tab) - I need to get the pick list values over to the lead object using a formula

I have a working  formula that will bring over one pick list value -- but I need to bring over all pick list values to a formula field on leads for the email merge to work..  How do I get more than one pick list value to come over to this leads field ?

If(INCLUDES( LeadCo__r.Per_Position__c ,"JAVA"),"JAVA ",
IF(INCLUDES( LeadCo__r.Per_Position__c ,".Net"),".Net ", NULL))

both .net and java are picked in the multi-pick list - but I only get "java" in my formula field on leads??

Have tried various AND and OR but keep getting syntax errors


I have about 35 values in the multi-pick list - any or mulitple can be selected and I would want to have the formula on the leads field bring each one over to the formula field in leads.


thanks in advance for assistance

I have a picklist field called "Line of Business" and if the picklist value selected by the user equals "Hotel Direct" then I want another picklist field "Property Type" to become mandatory.


Thanks for the help!!

I'm excited to announce that we've turned on some great new features for the discussion boards! The biggest new feature is the addition of Kudos. You may have noticed the new blue star that appears on posts right under the user's avatar. The number to the left of the star is how many kudos that post has received. If you want to give a user kudos for their post, just click the star and watch the number rise. The kudos count for an entire thread will show up in the message list so you can at a glance tell which threads are getting a lot of kudos. There's also a leaderboard for Top Kudoed Authors that you'll see on each category board as well as for overall board posts. This leaderboard spans a 30-day time frame so to stay at the top you'll have to be active in the community. Leaderboards are also available for Top Kudoed Posts and Top Kudo Givers. You can give out unlimited kudos, so don't be stingy! Kudos should highlight the quality posts on the boards. 


Another new feature is Search Before Post. Now as you go to create a new topic on the boards you'll notice a search drop down appearing as you type in a topic subject. The seach is looking for other topics that have similar words in the subject. This will help you locate any previous post that has already addressed your question, and you can go ahead and skip to the solution.


The final new feature is Quick Reply - which you'll see right below in this post! This will allow you to reply right from the post itself without having to navigate to another screen. Because this is a Quick Reply, you won't have the full WYSIWYG controls or be able to paste code; but it's great for quickly answering or asking a follow-up question.


I want to hear from you what you think of these new features and what else we can do to make the boards work best for you. There's some exciting stuff in the works, including a new ranking system, contests, and other fun stuff. This is your community; I want to hear from you!






I create a custom object "opp product"  and the reuirment is below:

field # 1: Process (which is flied date)

field # 2 : closing stage (which is pick list )

field # 3 = closing stage owner  (which is lookup field on oppportunity)

the reuirment is that if the processing filed had no date picked and closing stage = close complete then closing stage owner  should be null.

I am not sure that how to write a validation rule for this.

please help me and i am new to salesforce.



 I'm trying to compare values of two picklists to get the right value


For example if the cruise type is 'Half Day' and the Reseller is 'INP' the value is $16


I am using the following..... (excerpt only)


IF ((ISPICKVAL(RID__c,"Acorne")&&(ISPICKVAL(ET__c,"Half Day"))),16,
IF ((ISPICKVAL(RID__c,"Activity Gift/Maximise")&&(ISPICKVAL(ET__c,"Half Day"))),15,
IF ((ISPICKVAL(RID__c,"Activity Gift/Maximise")&&(ISPICKVAL(ET__c,"High Speed"))),20,
IF ((ISPICKVAL(RID__c,"Attraction World")&&(ISPICKVAL(ET__c,"Half Day"))),18,
IF ((ISPICKVAL(RID__c,"Buy a Gift")&&(ISPICKVAL(ET__c,"Half Day"))),12,
IF ((ISPICKVAL(RID__c,"Buy a Gift")&&(ISPICKVAL(ET__c,"Half Day for 2"))),6,
IF ((ISPICKVAL(RID__c,"Buy a Gift")&&(ISPICKVAL(ET__c,"High Speed"))), 7,




The formula works but there are so many picklist values that it is too big when it compiles


I'm trying to find a more effecient way of writing it so that it will compile and have tried 


IF (ISPICKVAL (ET__c,"Half Day"),CASE(RID__c,"Acorne",1,"Direct",2,0),
IF ((ISPICKVAL(ET__c, "High Speed"),CASE ((RID__c,"Acorne",1,"Direct",2,0))))



and also


CASE(ET__c,"Half Day", CASE(RID__c, "Acorne", 1, "Direct", 2, 0), "High Speed", CASE (RID__c, "Acorne", 5, "Direct", 10, 0)


but can't get the syntax right to make them work


Any suggestions?

I have written the following Validation rule; adding several different countries.  The request is if the Account Country is one of these Countries; then the Agent Sales Rep is to be required/mandatory.


The rule checks out ok but is not firing.  Any suggestions?


AND( $RecordType.Name = "BBA_Strategic_Account_Opportunity",  $RecordType.Name  = "BBA_Service_Programs", OR( BEGINS("Bangladesh",  Account_Country__c ), BEGINS("Belize",  Account_Country__c ), BEGINS("Bermuda",  Account_Country__c ), BEGINS("Bolivia",  Account_Country__c ), BEGINS("Chile",  Account_Country__c ), BEGINS("China",  Account_Country__c ), BEGINS("Costa Rica",  Account_Country__c ), BEGINS("Ecuador",  Account_Country__c ), BEGINS("El Salvador",  Account_Country__c ), BEGINS("French Guiana",  Account_Country__c ), BEGINS("Guatemala",  Account_Country__c ) , BEGINS("Guyana",  Account_Country__c ), BEGINS("Honduras",  Account_Country__c ) , BEGINS("India",  Account_Country__c ) , BEGINS("Mauritus", Account_Country__c ), BEGINS("Nepal",  Account_Country__c ), BEGINS("Nicaragua",  Account_Country__c ), BEGINS("Panama",  Account_Country__c ), BEGINS("Paraguay",  Account_Country__c ), BEGINS("Peru",  Account_Country__c ), BEGINS("Portugal",  Account_Country__c ), BEGINS("Spain",  Account_Country__c ), BEGINS("Sri Lanka",  Account_Country__c ), BEGINS("Suriname",  Account_Country__c ), BEGINS("Uruguay",  Account_Country__c ), ISBLANK( TEXT( Agent_Sales_Rep__c ))))

  • October 03, 2012
  • Like
  • 0
  1. I am trying to create a report that tells me by percentage how much a rep has grown month over month.  I am having trouble getting the formula to give me a percentage of Octobers sales verses Novembers sales.  It is giving me the percentage in $ instead of percentage even though I am telling it I want a percentage. 

Can anyone help me with the formula I need in the report to accomplish this.

I have an IF statement that needs to read


"New monthly rate going forward is $1,000.00"


My formula is


IF(ISBLANK( Custom_Description__c ),
"" ,
"New monthly rate going forward is" &""& Opportunity__r.Current_Monthly_Revenue__c)


but the Opportunity__r field is a currency field and the formula Error says "Incorrect parameter for function &(). Expected Text, received Number


Thank you in advance

  • July 12, 2010
  • Like
  • 2

Ultimately I am wanting to create a custom field called PO Received Month which pulls the month of the PO Received Date field, but in text format, not number format.


Currently this is the formula I put in the Formula Text field but its spitting out "4" for April and "5" for May and I want it to read "April" and "May".



TEXT(( YEAR( PO_Received_Date__c )))

 Thanks in advance!


I am a bit of a beginner at formulas, so hopefully one of you will think this is easy, and be able to help. :-)


Customer requirement:


Create a formula field that displays the Week Number (as Week 1, Week 2, etc), based on the Date entered on a particular record (same object).


Ex: 01/01/09 - 01/04/09 would return a value of "Week 1"  

01/05/09 - 01/11/09 = Week 2

01/12/09 - 01/18/09 = Week 3


and so on.....


Is using the CASE function the way to go, and if so, what's the shortest way to create this formula?


Thank you in advance!



  • April 20, 2009
  • Like
  • 0

Can you please help me what formula will need to use to get field value depending on which field been populated?

I have 2 custom fields:
1. Original Pick
2. Revised Pick

Then, I created formula field "Final_Pick__c". This formula field have a condition of if Original Pick is populated, value should be "Original Pick". Else, value should be Revised Pick.