+ Start a Discussion
salauncesalaunce 

Validation: Remove requirement for specific entries

Hello,

 

I need assistance writing a validation that will allow my users to skip certain required fields when a specific sales stage and probability % is selected.

 

Key Criteria 

Stage Name (Pipe Entry) - Picklist

Probability (0%) - Picklist

 

Required fields that should not have to be entered when the above is selected

 

Delivery Location (Picklist)

Entry Date (Date field)

Terms (Number field)

Potential Head Count (Number field)

Head Count (Number field)

Annual Bill Rate (Currency field)

 

Any help would be greatly appreciated.  I can't seem to get it and my users are not able to enter their pipe entries.

 

Desperate,

Simone

Best Answer chosen by Admin (Salesforce Developers) 
SteveMo__cSteveMo__c

If there is an exemption for an entire Division you could try: 

 

Addling them to the VR

 

NOT(ISPICKVAL( Division , "Exempt Division Name")

 

 So it would be something like:

 

 

 

 

 

AND(OR((Probability <> 0.00),NOT(ISPICKVAL( Division , "Exempt Division Name"),NOT(ISPICKVAL( StageName , "Pipe Entry"))),OR(ISPICKVAL( Delivery Location__c, ""),ISBLANK(Entry Date__c),ISBLANK(Terms__c), ISBLANK(Potential Head Count __c), ISBLANK(Head Count__c), ISBLANK(Annual Bill Rate__c)))

 

 

 

 

All Answers

SteveMo__cSteveMo__c

Try something like this:

 

AND( OR( (Probability > 0.00), NOT(ISPICKVAL( StageName , "Pipe Entry"))), OR( ISPICKVAL( Delivery Location__c, ""), ISBLANK(Entry Date__c), ISBLANK(Terms__c), ISBLANK(Potential Head Count __c), ISBLANK(Head Count__c), ISBLANK(Annual Bill Rate__c)))

 

 PS.  If it works you owe me a beer
http://www.russianriverbrewing.com/web/brews/plinytheelder.htm

 

salauncesalaunce

We can't go for beer's just yet...tee hee hee.

 

I entered the validation you sent (corrected a couple of field names/labels).

 

I entered a test oppty, set it to Pipe Entry with 0% probability, but the record still would not save and requested I complete the required fields....any thoughts?

 

Kind regards,

Salaunce

salauncesalaunce

One more thought....on the probability your formula looks like its saying if Probability is greater than "0". I need it to be equal to "0".

 

I really appreciate your help.

 

Chat w/ you soon.

 

Salaunce

SteveMo__cSteveMo__c

Okay, I misunderstood your original criteria.  If you tweak the exempted Probabilty% you should be all set.

 

 

PS.  I'm gettin' thirsty ;-)

Message Edited by Stevemo on 03-15-2010 04:06 PM
salauncesalaunce

I just replaced " > " with " = ", but still no cigar. The record continues to request that the fields be completed. Should I reverse the strategy and remove the field requirements and then right a validation so that if the entry is anything other than Pipe Entry and Probabiltiy % = 0...those fields would be required.

 

Can you help me write that, if you think is good solution?

 

Kind regards,
Simone Smith

 

PS. Shall I order a pitcher?

SteveMo__cSteveMo__c

Okay, lemme take another crack at this, I'm sure we're just a AND, OR, >, = away from solving this.

 

Basically what you want is:

 

IF

Stage =  "Pipe Entry"

AND

Probability = 0%

 

THEN 

These fields are NOT required:


Delivery Location (Picklist)

Entry Date (Date field)

Terms (Number field)

Potential Head Count (Number field)

Head Count (Number field)

Annual Bill Rate (Currency field)

salauncesalaunce

You got it!  That is exactly what I am looking for.

 

PS. Frosted mug or pilsner?

 

Kind regards,
Simone Smith

SteveMo__cSteveMo__c

Okay try this one, also double-check the spelling and punctuation of your Opportunity Stage picklist value, they have to match exactly otherwise the VR won't trigger properly.

 

 

AND(
OR(
(Probability <> 0.00),
NOT(ISPICKVAL( StageName , "Pipe Entry"))),
OR(
ISPICKVAL( Delivery Location__c, ""),
ISBLANK(Entry Date__c),
ISBLANK(Terms__c),
ISBLANK(Potential Head Count __c),
ISBLANK(Head Count__c),
ISBLANK(Annual Bill Rate__c)))

 

 

 For Pliny, definitely a Mug (unfrosted)

Message Edited by Stevemo on 03-15-2010 04:39 PM
salauncesalaunce

Good afternoon. Unfortunately, I still recieve error messages that the fields need to be populated in order to save the record...-sigh-.  Any thoughts on what else I could do to accomplish this?

 

Still thirsty? =)

SteveMo__cSteveMo__c

Hmmmm...  I've tested this on my Dev.SFDC.Org and it works fine.  

Have you double checked your Picklist Values and the spelling and punctuation in your VR formula? 

salauncesalaunce

Steve,

 

I went back and looked at the formula to ensure the correct field labels were listed correctly for each fieldOn the Delivery Location (picklist field), does he " " after the field name mean...if it's blankHere is it:

 

AND(OR(( Probability  <> 0.00),NOT(ISPICKVAL( StageName , "Pipe Entry"))),OR(ISPICKVALDelivery_Location1__c , ""),ISBLANK( Entry_Date__c ),ISBLANK( Term_Number_of_Months__c ), ISBLANK( Potential_Head_Count__c ), ISBLANK( Number_of_Resources__c ), ISBLANK( Annual_Bill_Rate__c )))

 

I'm not strong on puncuation in formulas and tend to rely on the syntax check to proofing formulas.

 

Here's another confusing thing....validations ask you to enter the error message if the criteria is not met, but in this case there should not be an error message. It would just be that the record could be saved without the info being populatedWould you just enter "none" for error message and not worry about it because it won't pop up anyway? Or should I revert to workflow rules? Sorry...new to the game and lacking some fundamentals.

 

Kind regards

Salaunce.

SteveMo__cSteveMo__c

Hi Saulance,

 

Yes

 

ISPICKVAL( Delivery Location__c, "")

 

 basically means "Picklist Value selected equals nothing" OR "No Picklist Value selected"

 

You do need to provide an error message, but users will only see the error message if they leave the required fields blank, and the Opportunity is NOT in the exempted Stage/Probability%  

 

Can you post your formula using the Code Clipboard (it eliminates all the smiley faces)? 

 

salauncesalaunce

Hi Steve,

 

Learned something new...code clipboard..makes sense!  Hope this helps. - Salaunce

AND(OR(( Probability <> 0.00),NOT(ISPICKVAL( StageName , "Pipe Entry"))),OR(ISPICKVAL( Delivery_Location1__c , ""),ISBLANK( Entry_Date__c ),ISBLANK( Term_Number_of_Months__c ), ISBLANK( Potential_Head_Count__c ), ISBLANK( Number_of_Resources__c ), ISBLANK( Annual_Bill_Rate__c )))

 

SteveMo__cSteveMo__c
Do you have any other VR's or Page Layout requirements that are active?  One of those might be the culprit.
salauncesalaunce

Hi Steve,

 

Yes. I only have two other validations for opportunities.

 

They are as follows:

 

This one forces the user to enter comments when they make changes to specific fields.

AND(OR(ISCHANGED(CloseDate), ISCHANGED(Estimated_Contract_Value__c), ISCHANGED(Term_Number_of_Months1__c), ISCHANGED(Bill_Rate1__c), ISCHANGED(Number_of_Resources1__c )), NOT(ISCHANGED(Opportunity_Change_Comments__c)),ISPICKVAL( S_Division__c , "SSC"))

 

AND

 This one will not allow sales reps to save oppty record if sales stage is proposal or better and ECV is null

AND ( OR ( ISPICKVAL(StageName, "Proposal"), ISPICKVAL(StageName, "MSA Status")), ISBLANK( Estimated_Contract_Value__c ) ,ISPICKVAL( S_Division__c , "SSC"))

 

Pipe Entry is the inital stage of entry. 

SteveMo__cSteveMo__c
What about Page Layout Requirements?
salauncesalaunce

Steve,

 

I have 16 required fields on the oppty layout. They are listed below.  I wonder if it would help if we included...AND Division equals SSC. This validation rule will only apply to users creating opportunities from the SSC Divsion.

  1. Delivery Location (Picklist)
  2. Entry Date (Date field)
  3. Terms (Number field)
  4. Potential Head Count (Number field)
  5. Head Count (Number field)
  6. Annual Bill Rate (Currency field)
  7. Close Date (Date field)
  8. Opportunity Name (Text)
  9. Account Name (Lookup)
  10. Stage (Picklist)
  11. Next Steps (Text)
  12. New vs. Growth (Picklist)
  13. Division (Picklist)
  14. Business Unit (Picklist)
  15. Sales Region (Picklist)
  16. Probability to Close (Picklist)
SteveMo__cSteveMo__c

Okay, I think that's those might be the culprit.  Try removing the Page Layout Requirements and just use the VR Requirements.  

 

Do you users in this Division also have a specific User Profile?  or do they have the same Profile as other users and vice versa?  

salauncesalaunce

The users in this division have the same profiles as others. This is something we are going to address this year...cleaning up profiles.  With that being said, what would I add to our current VR formula to make it specific to oppty records that had SSC listed as the division.

 

I really appreciate you helping me narrow this down! 

 

Kind regards,
Salaunce

SteveMo__cSteveMo__c

If there is an exemption for an entire Division you could try: 

 

Addling them to the VR

 

NOT(ISPICKVAL( Division , "Exempt Division Name")

 

 So it would be something like:

 

 

 

 

 

AND(OR((Probability <> 0.00),NOT(ISPICKVAL( Division , "Exempt Division Name"),NOT(ISPICKVAL( StageName , "Pipe Entry"))),OR(ISPICKVAL( Delivery Location__c, ""),ISBLANK(Entry Date__c),ISBLANK(Terms__c), ISBLANK(Potential Head Count __c), ISBLANK(Head Count__c), ISBLANK(Annual Bill Rate__c)))

 

 

 

 

This was selected as the best answer
salauncesalaunce

Mission Control....we have lift off!  Worked like a charm....removed requirements and added add'l division info to VR...and wah lah!

 

Thanks so much Steve!!!!!

SteveMo__cSteveMo__c
So when do I get my Pliny? ;- p