locked
Create a Yes/No Attriute RRS feed

  • Question

  • I'd like to creating a Yes/No attribute on an entity. I've tried making it a free text field and adding a business rule "must have one of the following values" however when I do that I get the message "The attribute's data type is not compatible with the rule type."

    What would be the correct way to create a Yes/No field?

    Wednesday, September 5, 2012 5:27 PM

Answers

  • Hi Anthony,

    Create a domain based attribute for your Yes/No attribute. 

    First create an entity called something like "YesNo".  Populate the YesNo entity with 2 members: one with code of Yes (or "Y" for Code and "Yes" for Name) and another member for No.

    Then create a domain attribute for your entity using the YesNo entity as the domain.

    Using the domain attribute will ensure that only valid values can be assigned.  You can then use a business rule to make this a required attribute if desired.

    Hope this helps,

    Pam Matthews

    www.profisee.com

    Thursday, September 6, 2012 8:45 PM

All replies

  • Hi Anthony,

    Create a domain based attribute for your Yes/No attribute. 

    First create an entity called something like "YesNo".  Populate the YesNo entity with 2 members: one with code of Yes (or "Y" for Code and "Yes" for Name) and another member for No.

    Then create a domain attribute for your entity using the YesNo entity as the domain.

    Using the domain attribute will ensure that only valid values can be assigned.  You can then use a business rule to make this a required attribute if desired.

    Hope this helps,

    Pam Matthews

    www.profisee.com

    Thursday, September 6, 2012 8:45 PM
  • I had thought of this myself, but my gut feels like that this is slightly abusing what an entity represents in a Master Data model.

    Maybe I'm just thinking of this too much by the book?

    Friday, September 7, 2012 7:05 PM
  • Hi Anthony,

    I have a YesNo entity for a few of my models, and have used the exact solution that Pam mentions.  So I second her approach!

    Thanks,

    James Serra


    James Serra

    Sunday, September 9, 2012 2:40 AM