You need to sign in to do that
Don't have an account?

Help With Validation Rule for Case and Custom Object
Good Evening, All,
I know that I am missing something simple here, but I don't know just what that simple is :-)
I am trying to create a validation rule that won't allow specific parts to be ordered when a specific drop down box field is chosen on a part order. Part Orders are cases, while the individual parts are custom objects.
Here is the rule I have in place:
AND (BEGINS( $RecordType.Name , "Part/Supply Order"), ISPICKVAL(Order_Type__c, "Parts"), OR( (Part_1__c = "09-5000 (Lids, Case (1000)" ), (Part_1__c = "09-1100 (Straws, 300 Count Package)" ), (Part_1__c = "09-5200 (Spoons, 1000/Case)" ), (Part_1__c = "09-1406 (Test Kit, Sanitizer)" ), (Part_1__c = "09-1410-A (Sanitizer Kit, Standard)" )))
The goal is to have an error displayed when a Party/Supply Order case record type is saved, the value "Parts" is selected in the drop down field "Order Type" and then one of the listed parts is put in the Part 1 field. The "Part 1" field is a lookup field for the parts custom object.
Any thoughts?
It seemed so easy and straighforward, but it apparently isn't!
Thanks!
Mike
Hi,
If you see "Part 1 >" below "Part 1" in the Insert Field selection window, give it a try.
This article would be a help:
http://wiki.developerforce.com/index.php/An_Introduction_to_Formulas
All Answers
Hi Mike,
As "Part 1" is a custom object lookup, Part_1__c in the code is just a Salesforce ID type field.
So you should use Part_1__r.Name or something instead.
It would be pretty easy by using "Insert Field" button above formula coding area.
Also, If the correct record type name is "Party/Supply Order", you need to correct the code though I guess it's a typo.
Good Morning!
Thank you for the assistance. I'm not sure what you mean, though.
"Part_1__c" is the actual field name of the lookup field. I did use "Insert Field" button to paste it into my formula.
Thank you again!
Hi,
If you see "Part 1 >" below "Part 1" in the Insert Field selection window, give it a try.
This article would be a help:
http://wiki.developerforce.com/index.php/An_Introduction_to_Formulas
Thank you, thank you, thank you!!!!!
That worked like a charm!