You need to sign in to do that
Don't have an account?
ACDSee
4 check boxes for different Tax scenarios
I created 4 custom fields (check boxes) on the Opportunity page for different tax scenarios my company has:
GST
GST & PST
HST
Miami Dade Tax
I need to prevent the opportunity from being saved if 2 or more check boxes are selected, while still being allowed to save the opportunity if no check boxes are selected. Any idea how I would do this?
FYI - I had started off with a picklist, but unfortunately you cannot write IF statements for picklists.
Error: Field TaxSelect is a picklist field. Picklist fields are only supported in certain functions.
Okay, then all you really need is one picklist and a couple of formula fields and you should be all set.
Picklist: Tax Type
Tax Rate: Formula(Percent(0))
IF(ISPICKVAL(TaxType__c, "GST"), 0.05,
IF(ISPICKVAL(TaxType__c, "GST & PST"), 0.12,
IF(ISPICKVAL(TaxType__c, "HST"), 0.12,
IF(ISPICKVAL(TaxType__c, "MDT"), 0.07,
0.00))))
Tax: Formula(Currency)
Amount * Tax_Rate__c
Total Amount: Formula(Currency)
Amount + Tax__c
All Answers
You mention that started with a pick list but cannot write IF statements. Have a look at IPICKVAL() See help
so I tried this, but I can't get the syntax correct...
CASE(Tax, IF(ISPICKVAL (TaxType__c, "GST"), 0.05 * Amount, IF(ISPICKVAL("GST & PST"), 0.12 * Amount, IF(ISPICKVAL("HST"), 0.12 * Amount, IF(ISPICKVAL("MDT"), 0.07 * Amount, 0)))))
Have you thought about changing it from 4 Checkbox fields to 2 Single-Value Picklists with a field dependancy? That would eliminate the need for a validation routine altogether.
Picklist 1(Master):
A
B
C
D
Picklist 2 (Dependant):
A
B
C
D
Picklist 1 = A: Picklist 2 Choices = B, C, D
Picklist 1 = B: Picklist 2 Choices = A, C, D
Picklist 1 = C: Picklist 2 Choices = A, B, D
Picklist 1 = D: Picklist 2 Choices = A, B, C
I think if I further clarify what I am trying to accomplish, it should help in finding a solution...
My company has offices in Victoria, BC (Canada) and Miami, FL (USA)
In order to create quotes I need:
The business logic is:
Make sense?
Okay, then all you really need is one picklist and a couple of formula fields and you should be all set.
Picklist: Tax Type
Tax Rate: Formula(Percent(0))
IF(ISPICKVAL(TaxType__c, "GST"), 0.05,
IF(ISPICKVAL(TaxType__c, "GST & PST"), 0.12,
IF(ISPICKVAL(TaxType__c, "HST"), 0.12,
IF(ISPICKVAL(TaxType__c, "MDT"), 0.07,
0.00))))
Tax: Formula(Currency)
Amount * Tax_Rate__c
Total Amount: Formula(Currency)
Amount + Tax__c
Stevemo....THANK YOU!!!!
Works like a charm. I was trying to do everything in a single statement, didn't think to split it out :P
No problem, that's why they pay me the BIG Bucks!
You could probably get there is a single formula (although I wouldn't wanna wrestle with it). Breaking it out also gives you the ability to pull things like your Tax Rate, Tax, etc. into reports and also display them right on the opportunity page for reference.