0

So I have a custom object called properties Properties has a master detail link to a person account, and there is a field called property type.

I only want to be able to assign one property type per person - so a person can only have 1 residential property.

I am currently writing a trigger to do this, but I think it could be done with validation rules - which would be better as then I would not need to write unit tests etc.

1
  • You've made a number of statements but it's unclear to me what you're asking. A validation rule can determine whether or not a value was entered for Properties. Workflow would be required to enter a value if it wasn't. Is that your question? – crmprogdev Mar 18 '15 at 13:21
3

Create a 1 roll-up summary field on Account per type of Property, where you summarize the number of Property records per type. Then write a validation rule on Account that states that your roll-up summary field value cannot be higher than 1.

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.