0

Can anyone suggest me how to validate field values in case object---for example I have 5 fields and I have a custom button named "Open Case" .When I click on these "Open Case" buttton these button has to validate all fields if any field is empty it throws an error other wise it should open that case

0

For this my solution would be to use validation rules.

https://help.salesforce.com/HTViewHelpDoc?id=fields_defining_field_validation_rules.htm&language=en_US

I'm assuming that when "Open Case" is clicked, a field is being updated to indicate that the case is open, we'll call that field Status.

AND(Status = Open OR(ISBLANK(OtherField), ISBLANK(SecondField)))

This error condition formula checks to see if any of otherfield or secondfield is blank, and checks to see if the case status is open.

If anything anywhere in salesforce, be it a button or a bit of apex code tries to change the case status to open while otherfield or secondfield is blank, or tries to blank either of those fields while the case is open, an error will appear.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.